Form. showdialog and form. Show

Source: Internet
Author: User

Assume that the following method is executed in a form1 form:
Private void testshowdialog ()
{
Form2 F2 = new form2 ();
F2.showdialog ();
// After the F2 form is displayed, the operation will be performed on the F2 form. form1 is temporarily restricted. If the pop-up F2 is closed, the following dialog box will pop up.
MessageBox. Show ("F2 is disabled! ");
}
If the following method is used
Private void testshow ()
{
Form2 F2 = new form2 ();
F2.show ();
// After the F2 form pops up, it will pop up below. The form1 and the new F2 pop-up can exist at the same time, and you can operate on any form as needed, if F2 is disabled, it will not affect form1,
MessageBox. Show ("F2 is not closed yet! ");
}
After showdialog is used, you can use f2.dispose (); to destroy the F2 form.

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.