Unfortuanally nothing is included that I know of other than going back to
the SHBrowseForFold er() API. Look that up on google and it should be pretty
strait forward on how to use. Only other solution is to write one from the
ground up.
Oh check this too:
This is not my work but was listed on a google search.
http://groups.google.com/groups?hl=e...FTNGP12&rnum=6
1. You need to add a reference to "System.Des ign" (system.design. dll).
2. You could try this...
Imports System.Windows. Forms.Design
Public Class OpenDirectoryDi alog
Inherits FolderNameEdito r
Dim _Description As String = "Please select a directory below:"
Dim _Path As String = String.Empty
Dim fb As New FolderBrowser()
Public Property Description() As String
Get
Return _Description
End Get
Set(ByVal Value As String)
_Description = Value
End Set
End Property
Public ReadOnly Property Path() As String
Get
Return _Path
End Get
End Property
Public Function ShowBrowser() As System.Windows. Forms.DialogRes ult
With fb
.Description = _Description
.StartLocation = FolderNameEdito r.FolderBrowser Folder.MyComput er
Dim result As DialogResult = .ShowDialog
If result = DialogResult.OK Then
_Path = .DirectoryPath
Else
_Path = String.Empty
End If
Return result
End With
End Function
End Class
'Usage:
Dim d As New OpenDirectoryDi alog()
With d
If .ShowBrowser = DialogResult.OK Then
txtDirectory.Te xt = .Path
End If
End With
"Pablo" <pp******@monte video.com.uy> wrote in message
news:0b******** *************** *****@phx.gbl.. .
Friends!
I need to show the dialog "select folder" and get the
path selected, using vb.net. The OpenFileDialog control
is useless as I want to select a folder and not a file.
In vb6 I achieved this by an OCX called DPDLG, but
in .net i do not find the solution neither this ocx works
in .net.
Any idea? sample code?
Thanks a lot
Pablo