Adding the Note Property to the Default Property Page

Add the Note property to the default property page to allow Circle control users to change its value.

First, use the resource editor to add an edit control to the default property page.

To add an edit control to the default property page

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

  2. Open the Dialog folder.

  3. Open IDD_PROPPAGE_CIRC to edit the property page template.

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

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

  6. Using the Text Properties dialog box, change the static text control's caption to &Note:.

  7. In the Controls toolbar, select the Edit Box tool and place an edit box control next to the static text control in the dialog box.

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

  9. Using the Edit Properties dialog box, change the edit control's ID to IDC_NOTE.

  10. Save the changes to the dialog box.

Link the Note property to the new edit control in the default property page using a shortcut to the Add Member Variable dialog box in ClassWizard.

To link the edit control with the Note property

  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 load the property page template.

  4. While holding down the CTRL key, double-click the edit box control for the Note property.

    This automatically opens the ClassWizard Add Member Variable dialog box.

  5. Type note in the Member variable name edit control, after the m_ that is already there, so that the edit control contains m_note.

  6. In the Category drop-down list box, select Value.

  7. In the Variable type drop-down list box, select CString.

  8. Type Note in the Optional property name drop-down combo box.

  9. Click OK to confirm your choices and close the Add Member Variable dialog box.

    If you were to open ClassWizard, the Member Variables tab would contain the new member variable mapping for the Caption property.

    Control IDs:       Type      Member
    IDC_CAPTION        CString   m_caption
    IDC_CIRCLEOFFSET   int       m_circleOffset
    IDC_CIRCLESHAPE    BOOL      m_circleShape
    IDC_NOTE           CString   m_note
    

ClassWizard adds the new m_note member variable to the CCircPropPage class. ClassWizard also modifies the DoDataExchange function in the CCircPropPage class.

The Note property is now fully implemented as a normal Get/Set property in the Circle control.