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