Call another window or dialog box in one window.
Now you haveTwoWindow:
The main window Form1 is used to call another window/dialog box through its menu items or buttons.
Dialog Box Union1, used for space overlay analysis window.
The purpose is to call the Union1 dialog box in the menu item of Form1 for space overlay analysis.
Method:
In Form1, double-click the corresponding menu item (for example, the Union item) to bring up the code editing window. Under the Union item, enter the following code:
- Union1 unionForm = new Union1 (); unionForm. ShowDialog ();
In the code above, Union1 refers to the dialog box used for space overlay analysis, and unionForm is a defined local variable.
The above code can also be written as follows:
- Union1 unionForm = new Union1 (); unionForm. Show ();
This code can also pop up the Union1 dialog box, but there is a difference between this and the first code above, that is, when using the ShowDialog () function, Form1 cannot be displayed as the current window, that is to say, the current window can only be Union1. When the Show () function is used, both windows can become the current window.