Directory Dialog Box

base836ball

Active member
Joined
May 4, 2005
Messages
31
Programming Experience
1-3
Ive been looking online for a Directory Dialog Box. I'm on Vb.Net 2003 V1 and I have the File Open Dialog. Is there any way of coding it so it selects a directory instead.
Thanks,
 
I use Visual Studio, so maybe it isn't present in the Toolbox by default in Visual Basic. It is a member of the System.Windows.Forms namespace though, so you must be able to add it to the Toolbox if it isn't there already. Whether it is in the Toolbox or not, you can still create one in code:
VB.NET:
		[color=Blue]Dim[/color] fbd [color=Blue]As New[/color] System.Windows.Forms.FolderBrowserDialog
		[color=Blue]Dim[/color] selectedFolder [color=Blue]As String[/color]

		[color=Blue]If[/color] fbd.ShowDialog() = DialogResult.OK [color=Blue]Then[/color]
			selectedFolder = fbd.SelectedPath
		[color=Blue]End If[/color]
 
Didnt work. It says

System.Windows.Forms.FolderBrowserDialog() is not defined

Microsoft Development Environment 2002 Version 7.0

Microsoft .NET Framework 1.0
Not sure if the version matters but as you can see I dont have the folder browser dialog. Kinda funny.....
 
Back
Top