Hiding the Standard Buttons

In the previous topic we discussed how to remove the Apply button. The technique covered here is applicable to any control as long as we know its control ID. When we hide a control using the ShowWindow() function all the other controls remain whereever they were. If the gap gives the property sheet an unappealing look, consider repositioning the other controls to fill up the gap.

The code below will hide the OK button. The IDs of the standard buttons are IDOK, IDCANCEL, IDHELP and ID_APPLY_NOW.


	CWnd *pWnd = GetDlgItem( IDOK );
	pWnd->ShowWindow( FALSE );



Comments

  • Destroying the HIDE Button

    Posted by SweetSarah on 04/13/2006 12:44am

    Hi all, rather than going through any long procedures just comment the following line in CPropertySheet derived class

    ON_COMMAND(ID_HELP, CWinApp::OnHelp)

    Regards,
    Sarah

    Reply
  • Easy way of hiding default buttons from PropertySheet with out error

    Posted by Legacy on 11/19/2003 12:00am

    Originally posted by: S. Soundar Rajan

    Easy way for removing default buttons from PropertySheet.
    
    


    HBRUSH CPropertySheetWnd::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
    {
    HBRUSH hbr = CPropertySheet::OnCtlColor(pDC, pWnd, nCtlColor);

    if(pWnd->GetDlgCtrlID() == IDOK) //Hide OK Button From Property Sheet
    pWnd->ShowWindow(FALSE);

    if(pWnd->GetDlgCtrlID() == IDCANCEL) //Hide CANCEL Button From Property Sheet
    pWnd->ShowWindow(FALSE);

    if(pWnd->GetDlgCtrlID() == ID_APPLY_NOW) //Hide APPLY Button From Property Sheet
    pWnd->ShowWindow(FALSE);

    return hbr;
    }


    Reply
  • Most Accurate DEFINITIVE & Easy way to Hide Help Button in VC6

    Posted by Legacy on 11/17/2003 12:00am

    Originally posted by: Yogesh Kshatriya

    The correct, defintive & easy way to hide the Help button is the one suggested by Stephane Pilote.

    Reply
  • Why doesn't the active page cahnge????????

    Posted by Legacy on 11/30/2002 12:00am

    Originally posted by: Catalin

    At CPropertySheet: i don't understand why after i receive the answer ok from the sheet, get active index only retreives the index of the first tab even if i changed it while running the application.
    it's like this

    if (dlgNew.DoModal() == IDOK)
    {
    int val = dlgNew.GetActiveIndex();
    ......
    }

    and i receive only 0;

    Reply
  • hiding default buttons of property sheet.

    Posted by Legacy on 10/17/2002 12:00am

    Originally posted by: nilesh

    u have given the code to hide the default buttons,but can u plz tell me where to write that code.

    Reply
  • How to i Handle the Help!!!!

    Posted by Legacy on 04/12/2002 12:00am

    Originally posted by: Rajesh

    Hi ,

    how do i handle the help in each page. for ex. i having each page in help button. If the user press the help button i want to show the message means. How i can do that?. How do i map the Help Button in the Class wizard. which message i have to handle?.

    any one give a idea pl.

    thanks,
    Rajesh. S
    (rajesh_s76@hotmail.com)

    Reply
  • how to remove the Cancel button....????

    Posted by Legacy on 11/19/2001 12:00am

    Originally posted by: Ganesh

    In my program I want to remove(not just hiding) the Cancel button from the Property sheet so that the OK button appears on the extreem right.. How to do it..??

    Any Idea..??

    Thanks,
    Ganesh

    Reply
  • How to stay on the same actived page after "OK" clicked (2)?

    Posted by Legacy on 11/16/2001 12:00am

    Originally posted by: Andreas Kops

    Hi,all Gurus:
    I have got the same problem.

    I want to verify something after "OK" button clicked in one PropertyPage, but if the condition is not valid, I need to stay in the same actived page. However, even I did not call CPropertyPage::OnOK(),the whole propertySheet are disapeared!! It is totally different than CDialog!
    Does anybody have good and simple idea to handle thai?
    Thanks in advance!

    Andreas

    Reply
  • DEFINITIVE way to hide the help button

    Posted by Legacy on 10/12/2001 12:00am

    Originally posted by: JT

    The method listed by Ed eichman does not work. It hides the "Help" button alright but if your mouse is active on the property sheet and you press the key F1, it launches the help. The only way it works is as stated by stephanie pilote..

    Reply
  • How to stay on the same actived page after "OK" clicked?

    Posted by Legacy on 10/03/2001 12:00am

    Originally posted by: James HU

    Hi,all Gurus:

    I want to verify something after "OK" button clicked in one PropertyPage, but if the condition is not valid, I need to stay in the same actived page. However, even I did not call CPropertyPage::OnOK(),the whole propertySheet are disapeared!! It is totally different than CDialog!
    Does anybody have good and simple idea to handle thai?
    Thanks in advance!

    James

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: August 20, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT When you look at natural user interfaces as a developer, it isn't just fun and games. There are some very serious, real-world usage models of how things can help make the world a better place – things like Intel® RealSense™ technology. Check out this upcoming eSeminar and join the panel of experts, both from inside and outside of Intel, as they discuss how natural user interfaces will likely be getting adopted in a wide variety …

  • Corporate e-Learning technology has a long and diverse pedigree. As far back as the 1980s, companies were adopting computer-based training to supplement traditional classroom activities. More recently, rich web-based applications have added streaming audio and video, real-time collaboration and other new tools to the e-Learning mix. At the same time, the growing availability of informal learning tools--a category that includes everything from web searches to social media posts--are having a major impact on …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds