Skip to content

Help with multi file selection #4

@desarrollo03TR

Description

@desarrollo03TR

Hi! I need to add the muti selection option. What I did is:

((OpenFileDialog)_MSdialog).Multiselect = this.MultiSelect;

And it is working, but I cannot get the list of selected files when there are 8 or more selected files:

case (uint)DialogChangeStatus.CDN_SELCHANGE:
    StringBuilder filePath = new StringBuilder(256);
    NativeMethods.SendMessage(new HandleRef(this, NativeMethods.GetParent(Handle)), (uint)DialogChangeProperties.CDM_GETFILEPATH, (IntPtr)256, filePath);
    if(_CustomCtrl != null)
    {
        if(_CustomCtrl.MultiSelect)
        {
            // filePath is empty if 8+ files are selected

I've tried with a bigger buffer;

StringBuilder filePath = new StringBuilder(8192);

Or even higher, but I have the same result, an empty string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions