[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Browse Folder Dialog
pradeepDate: Friday, 01 July 11, 4:28 PM | Message # 1
pk
Group: Administrators
Messages: 82
Status: Offline
Alright guys so I am going to show you how to create a browsefolderdialog. 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
Dim BrowseFolder As New FolderBrowserDialog

This defines BrowseFolder as your FolderBrowserDialog

Code
BrowseFolder.ShowDialog()

This makes your FolderBrowserDialog pop-up to the user and lets them select their path

Code
TextBox1.Text = BrowseFolder.SelectedPath

This sets your textbox1.text to what ever folder is selected.

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

This is how it will work when you are done:

[youtube]http://www.youtube.com/watch?v=ci9zC2HN8lA[/youtube]
 
  • Page 1 of 1
  • 1
Search: