By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,402 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

Something similar to DirListBox in VB6?

P: n/a
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?
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
Nov 20 '05 #2

P: n/a
Cor
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
Nov 20 '05 #3

P: n/a
Hello,

"Mrkrich" <mr*****@hotmail.com> schrieb:
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/miscct...derbrowser.asp
http://support.microsoft.com/?kbid=306285
http://www.gotdotnet.com/team/vb/FolderBrowser.exe
http://groups.google.com/groups?selm...40cpmsftngxa09

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.