Article ID: 140587
Article Last Modified on 11/21/2006
IDOK - OK button IDCANCEL - Cancel button ID_APPLY_NOW - Apply button IDHELP - Help buttonBefore you can set the focus to a button, the button must exist and be enabled. By default, the Apply button on a modal CPropertySheet is not enabled; it has to be explicitly enabled as shown in the sample code in this article.
SendMessage (DM_SETDEFID, IDC_MYBUTTON);
// This code sets the Apply button as the default
// CMySheet is derived from CPropertySheet
BOOL CMySheet::OnInitDialog()
{
CPropertySheet::OnInitDialog();
// Enable the Apply button
GetPage(0)->SetModified ();
// Set the Apply button as the default button
SendMessage (DM_SETDEFID, ID_APPLY_NOW);
return TRUE;
}
Additional query words: kbinf 4.00
Keywords: kbhowto kbpropsheet kbuidesign KB140587