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.
This topic is 4 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Showing multiple child forms

Post by Lembasts »

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Showing multiple child forms

Post by jvierra »

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Showing multiple child forms

Post by jvierra »

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 176 times
This topic is 4 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked