The usage of the Show. And ShowDialog methods in C # is different,

Source: Internet
Author: User

The usage of the Show. And ShowDialog methods in C # is different,

Show () is a non-modal form.
ShowDialog () is a mode form.

If Show is used at this time, it will happen that when the subform is opened and the main form is displayed again, the ShowDialog () when the child form is closed, the main form is displayed.
We can convert the show method to the showdialog method. As the name suggests, showdialog is a show method bound to a path. It cannot be switched freely, that is, if you do not close your current page, you cannot close any page next to the page. It is currently unique (opened by a channel) and is true.
Because the show method is not bound, the displayed windows and dialog boxes can be switched to each other without closing the current window and dialog box. However, the order of the window opened by the show method is not fixed because it is not bound. If there is any problem, the sequence of windows opened by the show method may be greatly changed!


The difference is that the form opened with showDialog () can be operated only after the form is closed, while show () is not subject to this restriction.
For example, you first open the subform and want to hide the main form.
If Show is used at this time, it will happen that when the subform is opened and the main form is displayed again, the ShowDialog () when the child form is closed, the main form is displayed.

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.