Hi All,
I'm working on PowerShell GUI based-script using Admin Script Editor and i have a question about creating a multiple forms for the same script (same PS project)
When i launch ScriptForm Designer, there is only one form named "Form1" and if i try to perform the action bellow, a new project is created ! :

File > New > PowerShell -> Native Windows Form
A new project "Untitled" is created

I want to create multiple form on the same project because my GUI PowerShell program will have multiple button that will open other winforms ...
Thanks in advance for your help.
i'll appreciate

0 Comments   [ + ] Show Comments


Please log in to comment


The only way I've been able to add additional forms is to code the object creation by hand. In the form creation section just add this line

$Form2 = New-Object System.Windows.Forms.Form

or whatever variable name you want, just as long as it's different from the original form. Save it, then open the scriptform designer and you'll see your extra forms.

My recommendation is to edit the form in a separate project with unique design names then when it looks good just copy and paste the code over.
Answered 02/02/2016 by: william.hsia@dss.ca.gov
White Belt

Please log in to comment
Answer this question or Comment on this question for clarity