Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OpenFileDialog & VB6 DriveListBox

77 views
Skip to first unread message

Mauro

unread,
Jun 2, 2003, 5:35:13 AM6/2/03
to
Hi,

I'm trying to port some VB6 code for a form that allows a user to select a
drive and a directory. The old DirListBox and DriveListBox controls have
been replaced by OpenFileDialog, but I cannot see any properties or methods
that allow me to only select directories.

Do I need to create a custom control based on the Common Dialog class?

Thanks

Mauro


Herfried K. Wagner

unread,
Jun 2, 2003, 4:35:19 PM6/2/03
to
Hello,

"Mauro" <mau...@mpt-ltd.com> schrieb:

You can use the folder browser dialog:

.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.

.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%40cpmsftngxa09

Regards,
Herfried K. Wagner
--
http://www.mvps.org/dotnet


Mauro

unread,
Jun 9, 2003, 6:06:05 AM6/9/03
to
Thanks for that. I should have specifed that I only have FX 1.1. Thanks also
for the alternative links.

In any case, many of the solutions I've found for FX 1.0 out there are in C#
and use SH Dlls which are not even guaranteed by Microsoft.

I ended up using some C# code and converting it to VB. It uses the WMI
namespace and can be found below.

http://www.sd.nl/software check the miscellaneous section. BSD
licensed, open source C# code. 100% .net, no dependencies on SH* dll's or
other stuff.

Regards,
Mauro Ciaccio

"Herfried K. Wagner" <hirf...@m.activevb.de> wrote in message
news:u#Oi7ZUKD...@TK2MSFTNGP10.phx.gbl...

0 new messages