Something similar to DirListBox in VB6?

  • Thread starter Thread starter Mrkrich
  • Start date Start date
M

Mrkrich

In VB.NET it doesn't have DirListBox control, I want to
retrieve the directory name so I try to use
OpenFileDialog/SaveFileDialog and like I guess it retrieve
the file name not directory. Does in VB.NET have some
control that can select the directory name rather than
file in that directory?
 
Hi Mark?

There's a class in System.Windows.Forms.Design
FolderNameEditor.FolderBrowser
which sounds like it might do the job.

The documentation says "This type supports the .NET Framework
infrastructure and is not intended to be used directly from your code.". I
don't know why - others here may be able to tell you why you shouldn't use it.

Try it and see if it bites. ;-)

Regards,
Fergus
 
Hi MrKrich,
In VB.NET it doesn't have DirListBox control, I want to
retrieve the directory name so I try to use
OpenFileDialog/SaveFileDialog and like I guess it retrieve
the file name not directory. Does in VB.NET have some
control that can select the directory name rather than
file in that directory?

That was one of my complains with VS.net 2002 too and I did try the same.
But it is now in VS.net 2003 and very professional DirListBox, not any more
that crampy one from VB6.
(It was one of the hidden advantages, now you can see it on some places in
the documentation).
It is called the FolderBrowserDialog.

I hope this helps a little bit.
Cor
 
Hello,

Mrkrich said:
In VB.NET it doesn't have DirListBox control, I want to
retrieve the directory name so I try to use
OpenFileDialog/SaveFileDialog and like I guess it retrieve
the file name not directory. Does in VB.NET have some
control that can select the directory name rather than
file in that directory?

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 PInvoke 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
 
Back
Top