So I tried using this code and it's not working:
CButton *btnApply;
btnApply = reinterpret_cast<CButton *>(GetDlgItem(IDOK));
btnApply->ShowWindow(FALSE);
Thanks in advance.
So I tried using this code and it's not working:
CButton *btnApply;
btnApply = reinterpret_cast<CButton *>(GetDlgItem(IDOK));
btnApply->ShowWindow(FALSE);
Thanks in advance.
In your property sheet:
BOOL CMyPropertySheet::OnInitDialog()
{
CWnd *pWnd = GetParent()->GetDlgItem(IDHELP);
pWnd->ShowWindow( FALSE );
CWnd *pWnd1 = GetParent()->GetDlgItem(IDCANCEL);
pWnd1->ShowWindow( FALSE );
CWnd *pWnd2 = GetParent()->GetDlgItem(IDOK);
pWnd2->ShowWindow( FALSE );
CWnd *pWnd3 = GetParent()->GetDlgItem(0x3021);// 0x3021 == IDAPPLY
pWnd3->ShowWindow( FALSE )
}
Use
PSH_NOAPPLYNOW
to hide the apply button in PropertySheetHiding OK and Cancel button can be handled in
CPropertyPage
, a handle to parent window is required because the buttons are in parent window not in page window:or in property sheet: