Article ID: 146916
Article Last Modified on 11/21/2006
// CMySheet is derived from CpropertySheet.
// Compile options needed: default.
BOOL CMySheet::OnInitDialog()
{
m_bModeless = FALSE;
m_nFlags |= WF_CONTINUEMODAL;
BOOL bResult = CPropertySheet::OnInitDialog();
m_bModeless = TRUE;
m_nFlags &= ~WF_CONTINUEMODAL;
return bResult;
}
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. Additional query words: modeless CPropertySheet buttons property sheet propertysheet
Keywords: kbcode kbdlg kbhowto kbuidesign KB146916