0

I'm looking for a .NET file/folder selection dialog that allows me to select multiple files AND folders at the same time. Not files OR folders. Both. At the same time. This would be similar to the functionality of Windows Explorer, where you can select multiple files/folders in the listview and then delete them all or copy and paste them all somewhere else or whatever.

I tried about a half dozen answers from this question: How do you configure an OpenFileDialog to select folders?

No dice. It was always multiple files OR folders, or not more than one at the same time.

I'll take anything at this point: a mod I can do to a .NET dialog, API calls, third-party library, whatever. For third-party, a common suggestion that comes up is Ookii, but as you can see here and here, it is also either/or, not both/and. If it is third-party, I'd prefer something with source, but at this point I'll take what I can get. Any help is appreciated.

WATYF
  • 409
  • 1
  • 5
  • 16
  • 1
    We don't do "find me a third party X that does Y" type questions, but we can tell you how to make it so the user can select multiple files and folders in Explorer, right click and Open With your app? (It's actually asked many times before; if you like the idea, you can check some of them..) – Caius Jard Jan 11 '21 at 17:09
  • Anything you can do in windows you can also do in c#. All the code is using the comdlg32 in windows but with different parameters. The c# code in Net is using s wrapper but limits the combination of options. So you can always use DllImport and specify the options you want. See : http://www.pinvoke.net/default.aspx/comdlg32.GetOpenFileName – jdweng Jan 11 '21 at 17:23
  • 1
    The structure is shown here : http://pinvoke.net/default.aspx/Structures/OpenFileName.html. You have to set the flags property shown in first line above. The c# call doesn't allow all combinations of the flags. – jdweng Jan 11 '21 at 17:29
  • Here is the definition of the bits : https://learn.microsoft.com/en-us/windows/win32/api/commdlg/ns-commdlg-openfilenamea – jdweng Jan 11 '21 at 17:40
  • 1
    [Show detailed Folder Browser from a PropertyGrid](https://stackoverflow.com/a/15386992/7444103). Customizable. – Jimi Jan 11 '21 at 18:20
  • @CaiusJard Honestly, that's news to me. Most of the questions I looked at for this issue are "where's a .NET library that does x" type questions. But to be clear, I'll take anything, including mod'ing a .NET Class in order to do what I want. I just can't find anything that does it. – WATYF Jan 11 '21 at 22:01
  • @jdweng That GetOpenFileName looks pretty much just like the OpenFileDailog and appears to have the same limitations. Do you know of a combination of flags that would allow the selection of multiple files and folders at the same time? – WATYF Jan 11 '21 at 22:15
  • It has been years since I've seen this issue. I've first say it in Win95 with the common dialog with microsoft c (before c++). – jdweng Jan 12 '21 at 00:59
  • OpenFileDialog seems to have a Multiselect property. – Mary Jan 12 '21 at 20:26

0 Answers0