C # Show () and showdialog () form. Show () are different from application. Run ().

Source: Internet
Author: User

Showdialog () pops up the modeled form

Show () pops up a non-modeled form

Mode form, which cannot be switched to the main form before being closed or hidden.

Non-mode form. You do not need to close the form if you change the focus.

Conclusion: To display important information, you can still use a mode form. For example, to delete an object, you can ensure that the object you really want to delete is

In non-mode, there is no way to know the order of form access, which is suitable for displaying some information about the program.

 

 

 

Application. Run () is "begins running a standard application message loop on the current thread, and makes the specified form visible." The code can be expressed:
While (getmessage (& MSG)> 0)
{
Translatemessage (& MSG );
Dispatchmessage (& MSG );
}
Directed by wm_quit, quit the application. The form. Show () method is used to display the form and exit the program immediately. If you use form. the showdialog () dialog box does not disappear immediately, but if you have other windows, form. showdialog () displays a modal window. Only when it exits can other windows be displayed. However, once the whole program is exited, other windows will never get a running opportunity, but application will be used. run.

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.