Hiding the Apply button

When the property sheet shows up, by default it has the Apply button visible and disabled. Often, we don't need the Apply button at all. Removing the button is a one liner and here's how. After you create the property sheet object just add the PSH_NOAPPLYNOW flag.

	propsheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;


  • Works perfect

    Posted by nxn128 on 11/23/2005 03:16pm

    Just what I was looking for.

  • How to add a property sheet to local area connection status page dialog?

    Posted by Legacy on 05/29/2003 12:00am

    Originally posted by: Slav

    I know that it is possible to extend standart property pages:
    In control panel - mouse settings, display settings etc.
    How to add a property sheet to local area connection status?

  • How to hide the "help" button in the CPropertySheet dialog?

    Posted by Legacy on 01/02/2003 12:00am

    Originally posted by: hanhd

    Thank you for helping me!

  • Right functionality of Apply Button

    Posted by Legacy on 03/28/2002 12:00am

    Originally posted by: luki

    hi, i'm making propertysheet dlg by using mfc. it means several PropertyPage dialogs in one PropertySheet dlg. My problem: if i delete or hide(ShowWindow(FALSE)) OK and Cancel buttons the Apply button will work not corectly. It means, to be enabled after change. It is enabled during all the existence of dlg. Can anybody help? I want to not to see Cancel,OK buttons in PropertyPage dlg and Apply button has right functionality at the same time. I handling Apply button by using OnCommand a OnApply methods thanks

  • How to Set Tool Tip for the Buttons - OK, Cancel, Help in the Property sheet?

    Posted by Legacy on 03/14/2002 12:00am

    Originally posted by: Shankar.V.V.S.N

    I need to set tool tip for the OK, CANCEL, HELP buttons in a property sheet. I don't have the ids of them. I tried with the IDs :

    OK : IDOK
    But i did not get the tool tip.

    [For getting tool tip, I used the following code:
    { .........
    BOOL <<<Someclassname>>>::PreTranslateMessage(MSG* pMsg)
    return CPropertyPage::PreTranslateMessage(pMsg);

    I generally use the above procedure for setting the tooltips for a known ids.
    Thanks In advance..

  • delete Apply button in a modal property sheet dialog

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

    Originally posted by: Fan Xia

    for a modal property sheet dialog, put line
    m_psh.dwFlags |= PSH_NOAPPLYNOW;

    in all constructor functions. then you can create a local property sheet object and call DoModal.

  • Removing Apply and Moving Buttons so it looks better

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

    Originally posted by: Joe Sonderegger

    The following code not only removes the Apply button, 
    but also moves the buttons so that it looks normal again.

    CRect rect;
    CWnd* pButton = GetDlgItem(ID_APPLY_NOW);
    pButton = GetDlgItem(IDCANCEL);

    CRect CancelRect;
    pButton->SetWindowPos(NULL, rect.left, rect.top, 0,
    pButton = GetDlgItem(IDOK);
    pButton->SetWindowPos(NULL, CancelRect.left,
    CancelRect.top, 0, 0, SWP_NOSIZE |


  • This how to remove some buttons easily...

    Posted by Legacy on 09/20/2001 12:00am

    Originally posted by: David A. Reyes

    This is the code showing how I did mine for a test app.

    BOOL CLearnerAppSheet::OnInitDialog()

    CButton* button;

    // Remove the "Apply" button...

    button = (CButton*) GetDlgItem(ID_APPLY_NOW);

    // Remove the "OK" button...

    button = (CButton*) GetDlgItem(IDOK);

    // Remove the "Cancel" button...

    button = (CButton*) GetDlgItem(IDCANCEL);

    // Set the dialog icons...

    SetIcon(m_hIcon, TRUE);

    return TRUE;

    I removed three of the four buttons this way... I think
    that HELP is nice where it is at if you are making an app
    that has the app on one page and the controls on the next

    Using this method to DestroyWindow() HELP button causes


  • How to add button into property sheet ??

    Posted by Legacy on 08/21/2001 12:00am

    Originally posted by: zoe

    how to add a new button into property sheet ??
    let say i want to add refresh button

  • I didn't have any button

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

    Originally posted by: hugo123

    I created a PropertySheet dialog and add it two dialog. But I have no button apply nor OK. How can I set them visible?

  • Loading, Please Wait ...

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

Top White Papers and Webcasts

  • Anthony Christie, the Chief Marketing Officer for Level Communications, is responsible for customer experience, worldwide marketing and product management. In this informative asset, he shares his insights into why a private network connection to cloud-bases applications is the right decision for your enterprise. Download now to find out more.

  • Moving from an on-premises environment to Office 365 does not remove the need to plan for disruptions or reduce the business risk requirements for protecting email services. If anything, some risks increase with a move to the cloud. Read how to ease the transition every business faces if considering or already migrating to cloud email. This white paper discusses: Setting expectations when migrating to Office 365 Understanding the implications of relying solely on Exchange Online security Necessary archiving …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date