Home General VB.NET Using the Folder Browse Dialog
20 | 05 | 2012
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade

Using the Folder Browse Dialog PDF Print E-mail
User Rating: / 0
PoorBest 
Tutorials

 

 

 

In Visual Studio add a FolderBrowseDialog to a Windows Form.

FolderBrowseDialog

The add a Button (Button1) and a textbox (TextBox1) to the form.

Form1

Then add the following code to the button.

    1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    2 

    3     '***********************************

    4     '*** Code From VisibleVisual.com ***

    5     '***********************************

    6 

    7     Dim Folder As String

    8 

    9     'Specify the root folder this example is set to the MyComputer

   10 

   11     FolderBrowserDialog1.RootFolder = Environment.SpecialFolder.MyComputer

   12 

   13     Folder = FolderBrowserDialog1.ShowDialog()

   14 

   15     'Display the selected folder into a textbox

   16 

   17     TextBox2.Text = FolderBrowserDialog1.SelectedPath

   18 

   19 End Sub

   20 

 

 

Now run the code and hit the button. You will see the following window

Select Folder

 

Select a folder and the path will be displayed into the textbox.

 

 

 

 

Add comment


Security code
Refresh

This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade