MFC supports stock color and font property pages that can be easily implemented in a control by adding entries to a control’s property page ID table. ClassWizard produces a default property page ID table in CIRCCTL.CPP that looks like this:
BEGIN_PROPPAGEIDS(CCircCtrl, 1)
PROPPAGEID(CCircPropPage::guid)
END_PROPPAGEIDS(CCircCtrl)
When editing the property page section, you must modify the page count number in the BEGIN_PROPPAGEIDS macro to reflect the actual number of property pages implemented by the control. In the case of the Circle control, this number is 3 when the color and font property pages are added. The first property page is the default generated by ControlWizard, the second is the color property page, and the third is the font property page.
To change the ID count and add lines for the color and font property pages
BEGIN_PROPPAGEIDS
. Add two lines to the code generated by ClassWizard in CIRCCTL.CPP as follows:BEGIN_PROPPAGEIDS(CCircCtrl, 3)
PROPPAGEID(CCircPropPage::guid)
PROPPAGEID(CLSID_CColorPropPage)
PROPPAGEID(CLSID_CFontPropPage)
END_PROPPAGEIDS(CCircCtrl)
The default property page allows properties to be viewed and edited. MFC also provides stock property page support for picture properties.