Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 12: Dialog-Based Windows


?? Title Bar: True or WS_CAPTION

?? System Menu: False or no WS_SYSMENU
?? Visible: False or no WS_VISIBLE
?? Disabled: True or WS_DISABLED
You can create each property page like that and with the same size. If you create dialog
boxes that have different sizes, the dimensions of the taller and/or wider will be applied
to all the other property pages when they come up.

Visual C++ makes it easy to create resources for property pages by displaying the Add
Resource dialog box, expanding the Dialog node and selecting one of the
IDD_PROPPAGE_X items.

After adding the resource for the property page, as done for a dialog box, you can add a
class for it. Unlike the regular dialog box, a property page is based on the
CPropertyPage class which itself is based on CDialog. The CPropertyPage class is
declared in the afxdlgs.h header file.

Practical Learning: Creating Property Pages



  1. Using either MFC AppWizard (exe) or MFC Application, start a New Project named
    Geometry

  2. Create it as Dialog-Based with no About Box and set the Dialog Title to
    Quadrilateral

  3. Change the Class Name of the dialog to CQuadrilateral

  4. Change the name of the header of the dialog to Quadrilateral.h and the name of the
    source file to Quadrilateral.cpp

Free download pdf