Page 1 of 1

is it possible to add a usercontrol?

Posted: Sat Dec 12, 2015 2:31 am
by hapoogold
Hi,
i want to know is it possible to add a usercontrol to the toolbox? So that I can create a custom control and use it in powershell studio?
I can do that in visual studio and I can have a dll file that I can import to toolbox of visual studio. I want to know if it is possible to do this in powershell studio?

Re: is it possible to add a usercontrol?

Posted: Mon Dec 14, 2015 8:26 am
by davidc
We don't support custom controls in the designer, because not all the .NET controls are completely compatible with PowerShell. Plus we test each individual control to ensure the generated code works properly.

David

Re: is it possible to add a usercontrol?

Posted: Mon Dec 14, 2015 8:29 am
by davidc
This doesn't mean you can't add your custom control in the script editor. You can use a placeholder control in the designer (such as a picturebox) and replace it with the custom control at runtime. The ElementHost control set is a good example of this.

David