HOWTO: How to Hide the Apply Button in CPropertySheet (141039)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++ for Windows, 16-bit edition 1.52
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 2.2
- Microsoft Visual C++, 32-bit Editions 4.0
This article was previously published under Q141039 SUMMARY
A modal CPropertySheet will automatically create an Apply button. To hide
this button, you need to use different methods for different versions of
MFC.
In Visual C++ 2.2 and earlier (MFC 3.2 and earlier), you can derive a class
from CPropertySheet, override OnCreate(), call GetDlgItem(ID_APPLY_NOW),
and finally call ShowWindow(SW_HIDE) to hide the Apply button.
In Visual C++ 4.0 (MFC 4.0), CPropertySheet has a public member called
m_psh. m_psh is a PROPSHEETHEADER structure with a dwFlags member. One of
the possible values of m_psh.dwFlags is PSH_NOAPPLYNOW. Setting this value
before the call to DoModal() hides the Apply button. Another option in
Visual C++ 4.0 is to call GetDlgItem()/ShowWindow(), but you should do it
in OnInitDialog() instead of OnCreate().
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbcode kbhowto kbPropSheet KbUIDesign KB141039 |
---|
|