What's best way to select folder

T

Tony Lin

What's the best way to provide users with a means to select a folder?


VS .NET version 1.1, has introduced a FolderBrowserDialog control, that at
first looks promising. However, in using it, I found two serious
deficiencies that make this a somewhat unattractive choice.



First, the initial folder can only be set by the RootFolder property, which
accepts an enumerated list of predefined folders such as Favorites, MyMusic,
ProgramFiles, etc. Since this is not a string property, you have no way to
set this to your own self-defined path. The best I can do is to have my
users start at MyComputers, but they are going to have a lengthy navigation
before they get to the folder they want.



Second, the FolderBrowserDialog has no up folder button, so if you make a
mistake in the lengthy navigation process, you have to cancel out of the
dialog window and start again!



The FolderBrowserDialog control seems promising in concept, but its
implementation makes this only about 50% useful.



I have considered using the OpenFileDialog control to select a folder but
this is not really suitable for folder selection.



Any suggestions?



Tony Lin

Fremont, CA
 
H

Herfried K. Wagner

Hello,

Tony Lin said:
What's the best way to provide users with a means to
select a folder?

Using P/Invoke to show the system's Folder Browser Dialog.
VS .NET version 1.1, has introduced a FolderBrowserDialog
control, that at first looks promising. However, in using it,
I found two serious deficiencies that make this a somewhat unattractive
choice.

NET 1.1:

System.Windows.Forms.FolderBrowserDialog

Note that there is a bug in Fx 1.1 that causes a really bad error when using
a path which is longer than ~128 characters. This occurs on unicode systems
only. Use the P/Invoke solutions mentioned below instead.

The property for hiding the button that allows the user to create a new
folder doesn't work on Windows 2000.

..NET 1.0:

http://www.codeproject.com/cs/miscctrl/folderbrowser.asp

http://support.microsoft.com/?kbid=306285

http://www.gotdotnet.com/team/vb/FolderBrowser.exe

http://groups.google.com/groups?selm=q0JKzDbmCHA.2144@cpmsftngxa09

Regards,
Herfried K. Wagner
 

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