Link to home
Start Free TrialLog in
Avatar of kso
kso

asked on

Removing Help button from a modal CPropertySheet

How can I remove/hide the Help button on an MFC modal CPropertySheet ?
Avatar of rajesh032097
rajesh032097

Hi,
CPropertySheet class has PROPSHEETHEADER structure member, m_psh, which has dwflag member. You can change the PSH_HASHELP flag of this structure to show / hide the help button.
Hope this works.

Avatar of kso

ASKER

Hi,
Which version of MFC are you using ?
You should not only exclude PSH_HASHELP flag, but also PSP_HASHELP:

PropSheet.m_psh.dwFlags &= ~PSH_HASHELP;
PropPage.m_psp.dwFlags &= ~PSP_HASHELP;
PropSheet.AddPage(&PropPage);
PropSheet.DoModal();

Excluding also PSP_HASHELP does not help.
My MFC version is 4.1
Avatar of kso

ASKER

All tried and no luck. Well are you familiar with the Spy++ tool. You can use a similar technique in your code. Inside the property page use the following technique :

{
//GetParent() get the handle of the CPropertySheet.
//Iterate through the child windows inside CpropertySheet and
//find the window with the ID IDHELP. This can be done using
//GetWindow() or EnumChildWindows() avoid FindWindow()
//Once you have the handle for the button , use ShowWindow() //or EnableWindow().

}
ASKER CERTIFIED SOLUTION
Avatar of mbhakta
mbhakta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial