moving from one form to the other

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 10 years and 10 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
piwi3910
Posts: 3
Last visit: Tue Aug 04, 2015 9:54 pm

moving from one form to the other

Post by piwi3910 »

hi, i'm trying to do the following.

i have a login form with a connect button.
and once clicking it i want my second form to be called.
i use the Call-Connecting_pff statement.
and then close the existing form.
i know about passing the variables from one form to the other.
But if i call the new form., my $form1.close doesn't happen until i close the connecting form.
so it seems it hangs in the loop waiting.
How do i simply go from one windows to another?
Or should i do it differently?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: moving from one form to the other

Post by jvierra »

Unfortunately you cannot do that. In PowerShell forms are dialogs that are the child of the form that opened them. They are also 'Modal' dialogs which means that when they open the parent form stops executing code until the child is closed.

PowerSHell cannot execute MOdelss dialogs or basic Windows. Ther eare numerous technical reasons for this.

There have been attempts at using a job to launch an independent form but I have never seen an example of this that was successful.
This topic is 10 years and 10 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