FOLDERBROWSERDIALOG BOX IN VB.NET

A FolderBrowserDialog control is used to browse and select a folder on a computer.

Private Sub btnBrowse_Click(sender As Object, e As EventArgs) Handles btnBrowse.Click
Dim folderDlg As New FolderBrowserDialog
folderDlg.ShowNewFolderButton = True
If (folderDlg.ShowDialog() = DialogResult.OK) Then
txtDir.Text = folderDlg.SelectedPath
Dim root As Environment.SpecialFolder = folderDlg.RootFolder
End If
End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *