The "MFC" dialog box appears. The "mfc" dialog box appears.

Source: Internet
Author: User

The "MFC" dialog box appears. The "mfc" dialog box appears.

In a slightly larger program, multiple forms are often required for exchange. Some forms appear to remind users or to implement a specified function. You do not want to operate other forms of the corresponding program before closing this window. This mode dialog box is used, this article describes how to create a simple dialog box in MFC and pop up the dialog box in a certain mode.

Step 1: Create a Dialog box, right-click the Dialog folder in the program resource view and Choose Insert Dialog box.

Step 2: add the corresponding dialog box class to the dialog box. Double-click the corresponding dialog box view and enter the class name in the displayed "MFC add Class Wizard". Click Finish.

Step 3: In the MFC Main Dialog Box class, include the header file of the generated dialog box class, for example, "# include" ShowUserDlg. h"

Step 4: Compile the code in the program to bring up the modal dialog box. The Code is as follows:

ShowUserDlg myshowursedlg; // ShowUserDlg is the dialog box class, And myshowursedlg is the dialog box class entity myshowursedlg. DoModal (); // display the Modal Dialog Box

OK, this is the success!




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.