FolderBrowserDialog to open and find a folder

AntonyLini 0 Tallied Votes 310 Views Share

Hello All,

Open Destination Folder programmatically using Folder Browser Dialog.
CodeSnippet attached below.

Usually all know about the dialogs available in .net like savefiledialog, openfiledialog, printfiledialog etc; but many of us dont know about folderBrowserdilaog.

Me too was unaware of it, and searched a lot to get code to open just folder. but It was disappointment.

Finally I got a hint of FolderBrowserDialog.

And I used the code mentioned below.
It was all I need.

[CODE]Dim folderBrowserDialog As New FolderBrowserDialog()
            folderBrowserDialog.Description = "Get Folder"
            folderBrowserDialog.RootFolder = Environment.SpecialFolder.MyComputer
            folderBrowserDialog.ShowNewFolderButton = True

            If folderBrowserDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
                   '--------------your code-------------------                
            End If[/CODE]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.