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: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • In this webinar, IDC featured speaker Steve Conway, Vice President of High Performance Computing, will present an update on the global x86 HPC cluster market. The presentation will include IDC's five-year forecast for the medium- to large-scale technical computing and data analysis emerging markets by systems, processors and application middleware. Cray's featured speaker, John Lee, Vice President of Cray Cluster Advanced Technology Systems, will present the new Cray® CS400™ cluster series based on …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds