Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Browse the Hard Disk and get path of a folder in Vb.Net 2005?
 

Browse the Hard Disk and get path of a folder in Vb.Net 2005?

I am developing a windows application in vb.net 2005.
On one form I will click on one "Browse" button and one dialog box for browsing Hard disk drive should get open.
Then I will select one folder from that dialog box and click ok. then path of that folder should be displayed in one textbox on the same form
I know how to do this for a file using OpenFIleDialog box, but how to do this for directory.
Harsh1  Monday, June 25, 2007 8:33 AM
Use the FolderBrowserDialog?
Karl Davies-Barrett - MCT  Tuesday, June 26, 2007 6:55 PM
Use the FolderBrowserDialog?
Karl Davies-Barrett - MCT  Tuesday, June 26, 2007 6:55 PM
Could u pleaseprovide me some code snippet to use that control.
Harsh1  Friday, June 29, 2007 6:40 AM

Drag it onto the form from the toolbox:

Then to call it upwrite:

Code Snippet
FolderBrowserDialog1.showDialog()

and to see what the user selected:

Code Snippet
Me.text = FolderBrowserDialog1.SelectedPath

Don't forget to check the value of selectedPath because the user may cancel the selection, in which case it will be empty!

so

Code Snippet

If FolderBrowserDialog1.SelectedPath <> "" then

' Do something with it

end if

Karl Davies-Barrett - MCT  Tuesday, July 03, 2007 7:40 AM
Karl Davies-Barrett - MCT wrote:

Drag it onto the form from the toolbox:

Then to call it upwrite:

Code Snippet
FolderBrowserDialog1.showDialog()

and to see what the user selected:

Code Snippet
Me.text = FolderBrowserDialog1.SelectedPath

Don't forget to check the value of selectedPath because the user may cancel the selection, in which case it will be empty!

so

Code Snippet

If FolderBrowserDialog1.SelectedPath <> "" then

' Do something with it

end if

Sorry to interfere, however I would be iterested to know if there is an equivalent method for Visual Basic for Excel. Your help will be very much appreciated.

Thanks

MihoMihov  Wednesday, January 23, 2008 6:00 AM

You can use google to search for other answers

Custom Search

More Threads

• developing games
• Custom ControlDesigner for a user control hosted in Internet Explorer
• Performance
• Event handling in design time mode
• Designer Serialization (SplitContainer, third parties etc.)
• Property To save toolstripbutton
• MenuStrip and Toolstrip Sound
• How can I set the Scrollbar Color for a TreeView?
• Feature rich .NET ComboBox control released!
• pass values from form3 to form1