471,577 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,577 software developers and data experts.

OpenFileDialog that can select folders?

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.

Feb 5 '06 #1
9 41040
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.

-------
Kristi.

Feb 5 '06 #2
Hello Michael,

http://groups.google.com/group/micro...1dc6236beb5fbc

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 Nietzsche
Feb 5 '06 #3
I know about FolderBrowserDialog. It does not show or follow shortcuts.
"Michael Nemtsev" <ne*****@msn.com> wrote in message
news:9c**************************@msnews.microsoft .com...
Hello Michael,

http://groups.google.com/group/micro...1dc6236beb5fbc

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 Nietzsche

Feb 5 '06 #4
Thanks to the 2 people who told me to use FolderBrowserDialog, but please
see second paragraph below. Any other ideas?

"Michael A. Covington" <lo**@ai.uga.edu.for.address> wrote in message
news:eZ**************@TK2MSFTNGP14.phx.gbl...
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...



Feb 5 '06 #5
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.

"Michael A. Covington" <lo**@ai.uga.edu.for.address> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Thanks to the 2 people who told me to use FolderBrowserDialog, but please
see second paragraph below. Any other ideas?

"Michael A. Covington" <lo**@ai.uga.edu.for.address> wrote in message
news:eZ**************@TK2MSFTNGP14.phx.gbl...
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...


Feb 5 '06 #6

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Of*************@TK2MSFTNGP14.phx.gbl...
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.
Feb 5 '06 #7
> 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.

"Michael A. Covington" <lo**@ai.uga.edu.for.address> wrote in message
news:u9*************@TK2MSFTNGP15.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Of*************@TK2MSFTNGP14.phx.gbl...
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.

Feb 6 '06 #8
Please try our Dialog Workshop .NET
CaOpenFileDialog component allows to select folders.

Please visit http://www.componentage.com for details.

Alex

"Michael A. Covington" <lo**@ai.uga.edu.for.address> wrote in message
news:eZ**************@TK2MSFTNGP14.phx.gbl...
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.

Feb 7 '06 #9
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

"Michael A. Covington" <lo**@ai.uga.edu.for.address> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Thanks to the 2 people who told me to use FolderBrowserDialog, but please
see second paragraph below. Any other ideas?

"Michael A. Covington" <lo**@ai.uga.edu.for.address> wrote in message
news:eZ**************@TK2MSFTNGP14.phx.gbl...
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...


Feb 7 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Michael A. Covington | last post: by
2 posts views Thread by Michael A. Covington | last post: by
reply views Thread by Jaco Karsten | last post: by
reply views Thread by Michael A. Covington | last post: by
4 posts views Thread by Chuck Edgeworth | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.