Question:
How can I close two windowed screens at the same time?
Solution:
To do so, follow these steps:
- Create an internal tag in the Viewer called ScreenControl;
- Create three screens: InitialScreen, Screen1 (windowed), and Screen2 (windowed);
- On InitialScreen, create a button to call Screen1. On this button, you must create an OpenScreen pick and set a nonexistent name to the frame where the Screen1 will open;
- On Screen1, perform the same settings of the previous exercise to call Screen2;
- On Screen2, create a button to close both Screen1 and Screen2. On the button, create a script that sets ScreenControl tag’s value as True, and use Screen2’s Close method;
- On Screen1, you must create a user event that is activated when ScreenControl tag’s value is True. In this event, create a script that sets ScreenControl tag’s value as False and use Screen1’s Close method.
See the attached sample application for further details.