Hiding the Standard Buttons

CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

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 );

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read