C # Call another window in one window

Source: Internet
Author: User

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:

  1. 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:

    1. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.