Adding Controls to the Default Property Page

When ControlWizard was used to create the Circle control, it included a default property page as part of the project. Property pages are listed in the property page ID table in CIRCCTL.CPP:

BEGIN_PROPPAGEIDS(CCircCtrl, 3)
    PROPPAGEID(CCircPropPage::guid)
    PROPPAGEID(CLSID_CColorPropPage)
    PROPPAGEID(CLSID_CFontPropPage)
END_PROPPAGEIDS(CCircCtrl)

The first entry in the Property page ID table is the default (or general) property page. The second and third entries are the stock color and font property pages that were added in Lesson 7, Handling Text and Fonts.

Initially, the default property page dialog box template is empty. You can use the dialog editor to add controls to the default property page.

To add the Caption property to the default property page

  1. In the ResourceView pane, open the Circ project folder.

  2. Open the Dialog folder.

  3. Open the IDD_PROPPAGE_CIRC entry in the Dialog folder to edit the property page template.

  4. Right click the static text control and click Properties on the shortcut menu to open the Text Properties dialog box.

  5. Using the Text Properties dialog box, change the static text control caption to &Caption:.

  6. Select the Edit Box tool in the Controls toolbar and place an edit box control next to the static text control in the dialog box.

  7. Right click the edit box control and click Properties on the shortcut menu to open the Edit Properties dialog box.

  8. Using the Edit Properties dialog box, change the edit control’s ID to IDC_CAPTION.

To add the CircleOffset property to the default property page

  1. Select the Static Text tool in the Controls toolbar and place another static text control in the dialog box.

  2. Right click the static text control and click Properties on the shortcut menu to open the Text Properties dialog box.

  3. Using the Text Properties dialog box, change the static text control’s caption to Circle&Offset:.

  4. Select the Edit Box tool in the Controls toolbar and place an edit box control next to the static text control in the dialog box.

  5. Right click the edit box control and click Properties on the shortcut menu to open the Edit Properties dialog box.

  6. Using the Edit Properties dialog box, change the edit control’s ID to IDC_CIRCLEOFFSET.

To add the CircleShape property to the default property page

  1. Select the Check Box tool in the Controls toolbar and place a check box control in the dialog box.

  2. Right click the check box control and click Properties on the shortcut menu to open the Check Box Properties dialog box.

  3. Using the Check Box Properties dialog box, change the check box’s ID to IDC_CIRCLESHAPE and change the check box’s caption to Circle&Shape; on the Styles tab, check the Left Text check box.

Once you have completed these procedures, arrange the controls using the Layout menu options and click Save on the File menu to save the property page template.