Article ID: 146916 - View products that this article applies to.
This article was previously published under Q146916
This article has been archived. It is offered "as is" and will no longer be updated.
Note Microsoft Visual C++ .NET (2002) supports both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The information in this article applies only to unmanaged Visual C++ code.
This article describes how to implement the standard OK, Cancel, and Apply buttons in a modeless CPropertySheet object.
For a modeless CPropertySheet, the Microsoft Foundation Classes (MFC) resize the sheet and hide the standard buttons in the CPropertySheet::OnInitDialog member function. To prevent MFC from doing this, perform the following steps:
In a modeless CPropertySheet object, the OK and Cancel buttons do not close the property sheet when they are clicked. They do send a WM_COMMAND message with IDOK or IDCANCEL to the sheet, and the OnOK or OnCancel functions are called for the page. To close the sheet, you can implement ON_COMMAND handlers for IDOK and IDCANCEL in the CPropertySheet and call the EndDialog function to close the sheet.
Article ID: 146916 - Last Review: February 27, 2014 - Revision: 3.2