everyone.
How do I call a number of forms one after another (meaning call new form after previous one is closed).
I wrote something like this;
Form1.Show();
Form2.Show();
and it naturally results in opening both forms simultaneously. How to make function to wait for the fist form to be closed?
Open one form, handle the FormClosed event, and open the second form from within that. Note that this is only necessary because your forms are not modal. If you were using
ShowDialog()the call would not return until the first form was closed and your code would work as it is currently structured.If you require non-modal behavior (i.e., your user must be able to interact with the owner form while the owned form is open) then use something like this: