Create mode and non-modal dialog box for VC

Source: Internet
Author: User

Create a modal dialog box

In the create mode dialog box, call the member function of the cdialog class: domodal. The function is to create and display a module.

The function for closing the modal dialog box is enddialog, which requires a parameter domodal

The Return Value of the function.

Ctestdlg DLG;
DLG. domodal (); // open the Modal Dialog Box

DLG. enddialog (idok); // closes the modal dialog box, which is equivalent to clicking the "OK" button in the modal dialog box.

Create non-Modal Dialog Box
The create member function of the cdialog class is used to create a non-modal dialog box.
Bool create (maid, cwnd * pparentend = NULL );
Bool create (uint nidtemplate, cwnd * pparentwnd = NULL)

The first parameter of the create function can be the resource ID of the dialog box or the name of the dialog box template. The second parameter specifies

The parent window of the dialog box. If its value is null, the parent window of the dialog box is the main application window.

Ctestdlg DLG;
DLG. Create (idd_dialog1, this );

Note: when using the create function to create a non-modal dialog box, you also need to call the showwindow function to display the dialog box
. That is, you need to add DLG. showwindow (sw_show );

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.