Where the FolderBrowserDialog control is used to browse and select a browser.
Now the question comes
How to use FolderBrowserDialog?
Drag and drop FolderBrowserDialog control from the toolbox on the window Form.
Drag and drop button and textbox, the button for showing browser dialog and textbox to show the selected path.
Drag and drop button and textbox, a button for showing browser dialog and textbox to show the selected path.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'FolderBrowserDialog will show
FolderBrowserDialog1.ShowDialog()
TextBox1.Text = FolderBrowserDialog1.SelectedPath
End Sub
Run the project
When you click the Browse button then FolderBrowserDialog will open.
When you select a file and click ok then the path of the selected file will show in the TextBox
Next Article :- MaskedTextBox Control in C#.Net
Leave Comment