OpenFileDialog that can select folders?

  • Thread starter Michael A. Covington
  • Start date
M

Michael A. Covington

Is there any way to hack OpenFileDialog (either in .NET 2.0 or in Win32)
that will allow the user to select a folder rather than a file? Better yet,
multiselect them.

I know about FolderBrowserDialog, but it's not satisfactory because it
doesn't show or follow shortcuts, and also because users are not as familiar
with it.
 
M

Michael Nemtsev

Hello Michael,

http://groups.google.com/group/micr...og+select+folder&rnum=1&#doc_d21dc6236beb5fbc

MC> Is there any way to hack OpenFileDialog (either in .NET 2.0 or in
MC> Win32) that will allow the user to select a folder rather than a
MC> file? Better yet, multiselect them.
MC>
MC> I know about FolderBrowserDialog, but it's not satisfactory because
MC> it doesn't show or follow shortcuts, and also because users are not
MC> as familiar with it.
MC>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
K

Kristi

Michael:

BrowseForFolder() API will allow you to select folder rather than
file.

The following code snippet required for selecting folder.
Shell32.ShellClass shl = new Shell32.ShellClass();
Shell32.Folder2 fld = (Shell32.Folder2)shl.BrowseForFolder(0,
strCaption, 0, System.Reflection.Missing.Value);

"fld.Self.Path" gives the absolute folder path.
 
M

Michael A. Covington

I know about FolderBrowserDialog. It does not show or follow shortcuts.
 
M

Michael A. Covington

Thanks to the 2 people who told me to use FolderBrowserDialog, but please
see second paragraph below. Any other ideas?
 
K

Kevin Spencer

Either roll your own or get one from a 3rd party vendor.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
 
M

Michael A. Covington

Kevin Spencer said:
Either roll your own or get one from a 3rd party vendor.

OK, I'd very much like to know how to do either one. This afternoon I'm
going to experiment with HookProc and see how much I can modify FileDialog.
I haven't found a 3rd-party product that actually fills the bill yet,
although there are lots of FileDialogs that are modified in *other* ways.
 
K

Kevin Spencer

I haven't found a 3rd-party product that actually fills the bill yet,
although there are lots of FileDialogs that are modified in *other* ways.

Besides that, one black box is as black as another, and 3rd party vendor's
black boxes aren't tested as well as Microsoft's. That's why I tend to roll
my own!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
 
A

Alex

Hello Michael,

As I moticed in the previous thread, please try Dialog Workshop .NET:

http://www.componentage.com

There are many advanched features in our dialog components including folder
selection in FileOpen dialog component.

-Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top