Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete the default Help button in CPropertySheet in MFC?

I am using CPropertySheet class for my design in MFC application,normally in CPropertySheet there would be 4 default buttons..I want to hide/delete the HELP button..I tried the following..but its not working/nither responding..I had this written in my CPropertyPage class is there any other way...

m_psh.dwFlags &= ~PSH_HASHELP;

like image 938
kiddo Avatar asked Dec 02 '09 11:12

kiddo


2 Answers

The property pages also have a HASHELP flag that needs to be cleared. The following code in the constructor of the property sheet should work:

// After the last AddPage() call:
m_psh.dwFlags &= ~PSH_HASHELP;
for(int i=0; i<GetPageCount(); ++i)
    GetPage(i)->m_psp.dwFlags &= ~PSP_HASHELP;

Alternatively, one can also modify the m_psp flag for each individual page before calling AddPage():

m_psh.dwFlags &= ~PSH_HASHELP;
page1.m_psp.dwFlags &= ~PSP_HASHELP;
AddPage(&page1);
// ...
like image 90
Olaf Mandel Avatar answered Sep 17 '22 15:09

Olaf Mandel


http://msdn.microsoft.com/de-de/library/37k4h0bh(v=vs.80).aspx

You have to remove the flag from the sheet and all pages...

mySheet.m_psh.dwFlags &= ~PSH_HASHELP;
page1.m_psp.dwFlags &= ~PSP_HASHELP;
page2.m_psp.dwFlags &= ~PSP_HASHELP;

...

Take care of the difference: m_psh vs. m_psp and PSH_HASHELP vs. PSP_HASHELP

like image 31
nobser Avatar answered Sep 18 '22 15:09

nobser