Solved

Removing Help button from a modal CPropertySheet

Posted on 1997-04-07
6
702 Views
Last Modified: 2013-11-20
How can I remove/hide the Help button on an MFC modal CPropertySheet ?
0
Comment
Question by:kso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 2

Expert Comment

by:rajesh032097
ID: 1300916
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.

0
 

Author Comment

by:kso
ID: 1300918
Hi,
Which version of MFC are you using ?
0
 
LVL 2

Expert Comment

by:rajesh032097
ID: 1300919
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();

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:serge010697
ID: 1300920
Excluding also PSP_HASHELP does not help.
My MFC version is 4.1
0
 

Author Comment

by:kso
ID: 1300921
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().

}
0
 
LVL 4

Accepted Solution

by:
mbhakta earned 100 total points
ID: 1300922
The easiest way to do it is to override OnInitDialog() of a propertypage of the sheet and add the following:

GetParent()->GetDlgItem(IDHELP)->ShowWindow(SW_HIDE);
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Separate into files by filename 12 91
Separate files macro - Errors on larger data set 18 73
Excel Use VBA to get user's Mac Address for their computer 5 344
canBalance challenge 34 105
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question