how to remove the apply and help button from propertysheet

  • Thread starter Thread starter ZhangZQ
  • Start date Start date
Z

ZhangZQ

how to remove the apply and help button from propertysheet?

I tried to
this->m_psh.dwFlags &= ~PSH_HASHELP;
this->m_psh.dwFlags |= PSH_NOAPPLYNOW;
this->m_psh.dwFlags |= PSH_NOCONTEXTHELP;

the "Apply" button can be removed, but the "Help" button still existed, hwo
to remove it?

Thank you very much!


ZhangZQ
 
how to remove the apply and help button from propertysheet?
I tried to
this->m_psh.dwFlags &= ~PSH_HASHELP;
this->m_psh.dwFlags |= PSH_NOAPPLYNOW;
this->m_psh.dwFlags |= PSH_NOCONTEXTHELP;

the "Apply" button can be removed, but the "Help" button still existed, hwo
to remove it?

You also need to remove the help flag for each property page. Have a
look at "Using Help in Property Sheets: CPropertySheet and
CPropertyPage" in the MSDN help.

Dave
 
ZhangZQ said:
how to remove the apply and help button from propertysheet?

I did it this way:

ReplaceButton (ID_APPLY_NOW, IDC_SAVE, IDS_SAVE, &m_btSave);
ReplaceButton (IDCANCEL, IDC_CLIPBOARD, IDS_COPY_ALL, &m_btCopyAll);
ReplaceButton (IDOK, 0, 0, NULL); // delete the OK button

void CMyPropSheet::ReplaceButton(int idOld, int idNew, int idText,
CButton* pButton)
{
CString str;
str.LoadString (idText);
ReplaceButton (idOld, idNew, str, pButton);
}

void CMyPropSheet::ReplaceButton(int idOld, int idNew, CString str,
CButton* pButton)
{
DWORD dwStyle = WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON;
CRect rc;

if (pButton)
{
GetDlgItem (idOld)->GetWindowRect(rc);
ScreenToClient (rc);
pButton->Create (str, dwStyle, rc, this, idNew);
pButton->SetFont (GetFont());
}
GetDlgItem (idOld)->DestroyWindow(); // Get rid of the old
button
}
 
Zhang can you try this ... So simple
CWnd* pWnd = NULL
pApply = GetDlgItem(ID_APPLY_NOW);

if(pApply != NULL)

pApply->ShowWindow(SW_HIDE);

regds
Jibesh..
 
Back
Top