Stop execution...

An action needs to show two windows, the first one has just some information and will close by itself after some time (with a timer) or by a click by the user.

The silly question is how to prevent the second window to open until first is closed?

dim w2 as new Window2 w2.Show dim w3 as new Window3 w3.Show and do other things

With this code the w3 is open immediately over w2, is there a way to say…?

while w is still open do not proceed

w2.Showmodal

should do it.

or open the window 3 if window 2 close.
you could also use events and use AddHandler to call any method.

ShowModal will work, but not exactly as I would, I’ll investigate the AddHandler …
Thanks

I would do it this way: Put

dim w3 as new Window3 w3.Show
in the Close event of Window2

thanks Eric, but the example was just a example to find a way to stop executions, after closing w2 different things will happen.

Use Exit or Return or add a time and do the stop…

??

Ok, sorry, I was thinking the reverse. Lockdown make some temporary diseases.

Open Window1 then in the close event of Window1, add Window2 show
So Window1 alone will show, then then Window1 closes, Window2 opens

Is that what you mean?

thanks Lennox, but the example was just an example to find a way to stop executions, after closing w2 different things will happen.

Even if it’s not perfect for my purpose, the easy way, (the opening as modal), is the approach I’m using.