Showing multiple child forms

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
Lembasts
Posts: 208
Joined: Thu Mar 15, 2012 9:47 am

Showing multiple child forms

Post by Lembasts » Sun Jul 28, 2019 5:21 pm

Greetings,

I have a mainform with several buttons. Each button launches another form using Show-<form>_psf.
When I launch a child form I cannot go back to the main form to launch another form.
Is it possible to launch multiple child forms?
Thanks
David

jvierra
Posts: 13891
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Showing multiple child forms

Post by jvierra » Sun Jul 28, 2019 6:10 pm

Not by any normal means. PowerShell only supports modal dialogs and not main forms. You can launch a separate, independent form By using a runspace.

jvierra
Posts: 13891
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Showing multiple child forms

Post by jvierra » Sun Jul 28, 2019 8:54 pm

I dug out an old demo project and tested it. It shows how to make a child form run as an independent form that does not block the main form.
Attachments
Demo-MultFormClient.zip
(133.1 KiB) Downloaded 35 times

Locked