User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
 

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:

Modern FolderBrowserDialog

If running on a legacy OS, it will then display the original FolderBrowserDialog:

Legacy OS FolderBrowserDialog

You can find the new control in the ToolBox Panel:

ToolBox Panel

To add the dialog, simply drag and drop it into your existing form.

The new FolderBrowserModernDialog has the following properties:

new FolderBrowserModernDialog 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.

 

If you have questions about our products, please post in our support forum.
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.
Copyright © 2024 SAPIEN Technologies, Inc.