The FolderBrowserModernDialog Control
- Details
- Written by David Corrales
- Last Updated: 22 April 2016
- Created: 01 May 2015
- Hits: 18320
This feature was added in response to user feedback. This particular user wanted to use the modern version of the folder browser dialog that is available in the later versions of Windows. Unfortunately, the user had to manually add code to the form to accomplish this. Therefore we added a new control to our toolbox:
FolderBrowserModernDialog
This control will display the modern version of the FolderBrowserDialog on Windows 7 or greater:
If running on a legacy OS, it will then display the original FolderBrowserDialog:
You can find the new control in the ToolBox Panel:
To add the dialog, simply drag and drop it into your existing form.
The new FolderBrowserModernDialog has the following properties:
Title
This property sets the title of the folder browser dialog.
SelectedPath
This property sets the selected path of the dialog and returns the path the user selected.
Using the Dialog:
Here is an example of how to display the FolderBrowserModernDialog using its ShowDialog method:
$folderbrowsermoderndialog1.SelectedPath = $textboxPath.Text if ($folderbrowsermoderndialog1.ShowDialog() -eq 'OK') { $textboxPath.Text = $folderbrowsermoderndialog1.SelectedPath }
The modern versions of the FolderBrowserDialog makes for a better user experience and we hope that your GUI users agree.
David Corrales is Senior Software Engineer at SAPIEN Technologies, Inc. Follow him on Twitter at @SAPIENDavid.
This article applies to PowerShell Studio v4.2.83 and later.
For licensed customers, use the forum associated with your product in our Product Support Forums for Registered Customers.
For users of trial versions, please post in our Former and Future Customers - Questions forum.