Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 15: Fundamental Controls



  1. Test the application. When the dialog box displays, click the WordPad button to see
    it launch

  2. Close the dialog box and return to MSVC


15.5 Property Sheet and Wizard Buttons.........................................................


15.5.1..Property Sheet Buttons.......................................................................


There are two types of property sheets: modal and modeless. A modeless property sheet
does not display buttons.

A modal property sheet is equipped with command buttons that allow the user to make a
decision after selecting items on the pages or changing the values of the page’s controls.
By default, after creating a property sheet, it is equipped with the OK, the Cancel, and the
Apply buttons.

By design, the CPropertySheet class, which is the implementer of the property sheet,
has a member variable called m_psh. This member represents the
PROPSHEETHEADER structure, which is the Win32 implementer of a property sheet.
One way you can use the m_psh member variable is to hide the Apply button if you do
not need it in your application. Otherwise, this button is available by default on a
property sheet.

Here is an example from the Components dialog box of Microsoft Visual Basic:

In this classic design, the functionality of the buttons is commonly standardized:
?? The OK button allows the user to validate any change(s) made on the control(s)
of the property page(s) and close the dialog box. For example, if the user
changes text from an edit box and clicks OK, the application that called the
dialog will have the opportunity to acknowledge the change and act accordingly,
and the property sheet would be closed
Free download pdf