Article ID: 141039
Article Last Modified on 11/21/2006
/***** this code applies to Visual C++ 4.0 and later *****/
void CMyView::OnDisplayModalSheet()
{
CMySheet sheet ("Set Properties");
// this hides the Apply button
sheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;
sheet.DoModal ();
}
/* You can also do the following to hide the Apply button */
BOOL CMySheet::OnInitDialog()
{
CPropertySheet::OnInitDialog();
// this hides the Apply button
CWnd* pApplyButton = GetDlgItem (ID_APPLY_NOW);
ASSERT (pApplyButton);
pApplyButton->ShowWindow (SW_HIDE);
return TRUE;
}
/*********************************************************/
/***** this code applies to Visual C++ 2.2 and earlier *****/
int CMySheet::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
return -1;
// this hides the Apply button
CWnd* pApplyButton = GetDlgItem (ID_APPLY_NOW);
ASSERT (pApplyButton);
pApplyButton->ShowWindow (SW_HIDE);
return 0;
}
/*********************************************************/
Additional query words: kbinf 1.52 2.00 2.10 2.20 4.00
Keywords: kbcode kbhowto kbpropsheet kbuidesign KB141039