[vb.net] Calling the system's Folder selection dialog box

Source: Internet
Author: User

The following sample code shows how to invoke the system's Folder selection dialog box:

1     Private FunctionSelectfolder (ByValDescribe as String,Optional ByValShownewfolder as Boolean=True) as String2         UsingNopen as NewSystem.Windows.Forms.FolderBrowserDialog ()3Nopen.description =Describe4Nopen.shownewfolderbutton =Shownewfolder5 Nopen.showdialog ()6             ReturnNopen.selectedpath7         End Using8     End Function

Call Mode:

1     Private SubButton2_Click (ByValSender asSystem.Object,ByValE asSystem.EventArgs)HandlesButton2.click2         Dim_selectedfolder as String= Selectfolder ("Please select the installation directory",True)'Displays the Select installation directory interface, while allowing new folders to be created3         MsgBox(_selectedfolder)4     End Sub5 6     Private FunctionSelectfolder (ByValDescribe as String,Optional ByValShownewfolder as Boolean=True) as String7         UsingNopen as NewSystem.Windows.Forms.FolderBrowserDialog ()8Nopen.description =Describe9Nopen.shownewfolderbutton =ShownewfolderTen Nopen.showdialog () One             ReturnNopen.selectedpath A         End Using -     End Function

[vb.net] Calling the system's Folder selection dialog box

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.