I have a textBox which gets filled with a path, acquired from a database (but that's irrelevant). So I want to have a FolderBrowserDialog button where I open -> navigate through the folders and select a path (i.e. by selecting a certain folder) and then OK/Save-ing this path and it to be updated in the textBox.
So in the whole case - I don't know how to use the OpenFolderBrowserDialog, because when I drag it - it only goes in the bottom of the page, but I want to place it as a button on a certain place in my WinForm. And also - how is the selected path saved into a (i.e. string) variable so I can set it as the value of the textbox? A certain method?
Here is a better version. Put this code in a module
Use it like this
Try like below it will help you..
Place a
Text box
,Button
andFolderBrowserDialog
in yourForm
like below...Then
Double click the button
andcreate Button click Event
on your code like below..Then run it.. Now you can open the Folder Browser dialog by clicking the Browse Button..
After selecting the folder Path the path will assigned to Text Box
You can also refer this Article for full reference : FolderBrowserDialog