Code Snippets

  

VB.NET Source Code


Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 98,767 VB.NET Programmers for FREE!. Ask your question and get quick answers from Dream.In.Code experts. There are 1,016 online right now! We're the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a VB.NET Expert

Register to Make This Box Go Away!



Open a Folder Browse Dialog window

This will open a dialog window so that a user can browse to a specific folder.

Submitted By: jayman9
Actions:
Rating:
Views: 17,459

Language: VB.NET

Last Modified: August 16, 2006

Snippet


  1. ' First create a FolderBrowserDialog object
  2. Dim FolderBrowserDialog1 As New FolderBrowserDialog
  3.  
  4. ' Then use the following code to create the Dialog window
  5. ' Change the .SelectedPath property to the default location
  6. With FolderBrowserDialog1
  7.     ' Desktop is the root folder in the dialog.
  8.     .RootFolder = Environment.SpecialFolder.Desktop
  9.     ' Select the C:\Windows directory on entry.
  10.     .SelectedPath = "c:\windows"
  11.     ' Prompt the user with a custom message.
  12.     .Description = "Select the source directory"
  13.     If .ShowDialog = DialogResult.OK Then
  14.         ' Display the selected folder if the user clicked on the OK button.
  15.         MessageBox.Show(.SelectedPath)
  16.     End If
  17. End With

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month
-->