FolderBrowserDialog Box in VB.NET

FolderBrowserDialog Box in VB.NET

Step 1: Create a new project and form

Step 2: Add a TextBox, Button and FolderBrowserDialog to the form.

Step 3: Double click btnBrowse, and key in the following codes.

    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

Step 4: Run the project.




Comments

Popular posts from this blog

How to install FlameRobin on Windows 10

How to install MySQL Workbench on Windows 10