VS2010/MFC dialog box: Create and display the General Property Page dialog box

Source: Internet
Author: User

Create and display the General Property Page dialog box

This section describes the creation and display of the General Property Page dialog box.

In fact, the process of creating and displaying the General Property Page dialog box is very similar to the wizard dialog box. Chicken Peck Rice Make a few changes to the wizard dialog box in the previous section, making it a General Property Page dialog box.

General Property Page dialog box creation steps:

1. Create a Property Page Dialog resource

The property Page dialog resource is created in the same way as the wizard dialog box, and the dialog resource in the previous session does not need to be modified.

2. Create a property page class

The property page class's Creation and the wizard dialog box's property page class are basically the same, except that the "next" and "Finish" buttons are not required in the General Property Page dialog, so overloaded functions such as onsetactive and onwizardfinish of the property page class in the previous lecture can be removed. That is, the onsetactive function in the Csummandpage class, the OnSetActive function in the Caddpage class, and the Onwizardfinish function can be deleted or commented out. No modifications are required for other parts.

3. Create a property sheet class

The process of creating a property sheet class is the same as the wizard dialog box property sheet class, so the Caddsheet class in the previous lecture does not need to be modified.

4. Display the General Property Page dialog box

The display of the Previous wizard dialog box is implemented in the Onbnclickedinstructbutton function, where the statement is sheet. SetWizardMode (); Is intended to set the property sheet as a wizard dialog mode, so you do not need to call the SetWizardMode member function when you display the Generic Property Page dialog box. In addition, we can set the title of the Property Page dialog box to "Usage description", passing this string as a parameter to the constructor when constructing the property sheet object. The Onbnclickedinstructbutton function is modified as follows:

C + + code
    1. void Cadditiondlg::onbnclickedinstructbutton ()
    2. {
    3. //Todo:add your control notification handler code here
    4. //Create attribute Table object
    5. Caddsheet sheet (_t ("Instructions for use"));
    6. //Open Modal General Property Page dialog box
    7. Sheet. DoModal ();
    8. }

So when the General Property Page dialog box is created and displayed, let's run the next program and click the "Use Instructions" button on the results dialog to see how it works:

In summary, the differences between the creation and display of the General Property Page dialog box and the wizard dialog box include whether overloaded functions such as onsetactive and onwizardfinish are required, and whether the SetWizardMode function that calls the property sheet class needs to be set to the wizard dialog mode.

Is it easy to create and display a General Property Page dialog box? Here, the Property Pages dialog box is finished.

VS2010/MFC dialog box: Create and display the General Property Page dialog box

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.