jordan

jordan

  • NA
  • 7
  • 11.1k

Browse Folder Dialog

Aug 30 2010 1:06 PM

Alright guys so I am going to show you how to create a browse folder dialog. All this does it popup to the user and let them choose a folder.

For this you need:
1 Button
1 Textbox

Double click your button and add in the code:

[code]Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim BrowseFolder As New FolderBrowserDialog
        BrowseFolder.ShowDialog()
        TextBox1.Text = BrowseFolder.SelectedPath
    End Sub[/code]



[code]Dim BrowseFolder As New FolderBrowserDialog[/code]
This defines BrowseFolder as your FolderBrowserDialog

[code]BrowseFolder.ShowDialog()[/code]
This makes your FolderBrowserDialog pop-up to the user and lets them select their path

[code]TextBox1.Text = BrowseFolder.SelectedPath[/code]
This sets your textbox1.text to what ever folder is selected.

After that you can do whatever you want with your selected folder.