Better alternative FolderBrowserDialog

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
PGomersall
Posts: 90
Joined: Sun Mar 03, 2013 12:40 pm

Better alternative FolderBrowserDialog

Post by PGomersall » Tue Aug 26, 2014 8:38 am

Hi at Sapien,
I am wondering if you can answer if it is possible to add the ookii.dialogs.dll (http://www.ookii.org/Software/Dialogs/) to a Powershell GUI so one can access better Folder Browser Dialog that will work with UNC paths or possibly incorporating the C# code at http://www.lyquidity.com/devblog/?p=136.
I am owner of PSS 2014.
Regards,
Pete

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Better alternative FolderBrowserDialog

Post by davidc » Tue Aug 26, 2014 10:16 am

Outside controls are not supported by the designer, but that doesn't mean you can't use the third party controls via your script. You should be able to load the assemblies using Add-Type cmdlet. In addition, you will need to distribute the assemblies alongside your script.

I would recommend using a place holder control in the designer to make it easier to display the new controls. An example of this technique is used in the ElementHost control set in which it uses a picture box control as a place holder and calls the Replace-PlaceHolder helper function to swap in the new control.

David
David
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Better alternative FolderBrowserDialog

Post by davidc » Tue Aug 26, 2014 10:17 am

In the case of a dialog, you will not need a place holder.

David
David
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Better alternative FolderBrowserDialog

Post by davidc » Fri May 01, 2015 8:39 am

This might interest you:

https://www.sapien.com/blog/2015/05/01/powershell-studio-2015-new-folderbrowsermoderndialog-control/

David
David
SAPIEN Technologies, Inc.

Locked