FolderBrowserDialog Component Overview (Windows Forms)
The Windows Forms FolderBrowserDialog component is a modal dialog box that is used for browsing and selecting folders. New folders can also be created from within the FolderBrowserDialog component.
Note |
---|
To select files, instead of folders, use the OpenFileDialog component. |
The FolderBrowserDialog component is displayed at run time using the ShowDialog method. Set the RootFolder property to determine the top-most folder and any subfolders that will appear within the tree view of the dialog box. Once the dialog box has been shown, you can use the SelectedPath property to get the path of the folder that was selected.
When it is added to a form, the FolderBrowserDialog component appears in the tray at the bottom of the Windows Forms Designer.
See Also
Tasks
How to: Choose Folders with the Windows Forms FolderBrowserDialog Component