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

  • Today's agile organizations pose operations teams with a tremendous challenge: to deploy new releases to production immediately after development and testing is completed. To ensure that applications are deployed successfully, an automatic and transparent process is required. We refer to this process as Zero Touch Deployment™. This white paper reviews two approaches to Zero Touch Deployment--a script-based solution and a release automation platform. The article discusses how each can solve the key …

  • On-demand Event Event Date: December 18, 2014 The Internet of Things (IoT) incorporates physical devices into business processes using predictive analytics. While it relies heavily on existing Internet technologies, it differs by including physical devices, specialized protocols, physical analytics, and a unique partner network. To capture the real business value of IoT, the industry must move beyond customized projects to general patterns and platforms. Check out this webcast and join industry experts as …

Most Popular Programming Stories

More for Developers

RSS Feeds