Property sheet

I have created a property sheet consists of 4 pages.
The property sheet contains 4 buttons:
OK, Cancel, Apply, Help
How to remove Apply and Help buttons from the property sheet and move the OK and Cancel buttons to the of the Apply and Help buttons?
Best if you can provide some sample code to do this.
Thanks
recceAsked:
Who is Participating?
 
chensuConnect With a Mentor Commented:
CMyPropertySheet mySheet;

mySheet.m_psh.dwFlags &= ~(PSH_HASHELP);

mySheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;

mySheet.DoModal();
0
 
recceAuthor Commented:
chensu, your code remove only the Apply button. The Help button still present.
Pls advice
0
 
chensuCommented:
Also, for each property page, remove the PSP_HASHELP flag for the dwFlags member of the PROPSHEETPAGE structure.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
recceAuthor Commented:
chensu, please explain how to do that
0
 
chensuCommented:
For each page, do the following before calling AddPage.

CPropertyPage Page1;

Page1.Construct(ID_PAGE1);

Page1.m_psp.dwFlags &= ~(PSP_HASHELP);

AddPage(&Page1);
0
 
recceAuthor Commented:
chensu, please explain how to do that
0
 
recceAuthor Commented:
chensu, i tried but the HELP button still present.
0
 
recceAuthor Commented:
I made a mistake, your code works.
Thanks alot.
One last simple question if you don't mind.
which method is called when the
OK button is clicked.
0
 
chensuCommented:
>which method is called when the OK button is clicked.

CPropertyPage::OnOK
0
 
recceAuthor Commented:
Thanks a lot for your help.
I have increased the point to 150.
One more question:
If I choose to use the Apply now,
how to use the button?
It is grayed when the program everytime the program started.
0
 
recceAuthor Commented:
Adjusted points to 150
0
 
chensuCommented:
Call CPropertyPage::SetModified to enable or disable the Apply Now button. And CPropertyPage::OnApply is called when the Apply Now button is clicked.
0
 
recceAuthor Commented:
but how to detect a change in any of the property pages so as to enable the Apply Button.
0
 
chensuCommented:
That has to be done by each property page. The property sheet does not know it.
0
 
recceAuthor Commented:
is there any property page method that detect if any of its controls changes state?
0
 
recceAuthor Commented:
I tried to use SetModified(TRUE), but couldn't get it to work, the Apply button still disable.
0
 
chensuCommented:
>is there any property page method that detect if any of its controls changes state?

It depends on what controls you are using. For example, an edit control sends EN_UPDATE or EN_CHANGE.

>I tried to use SetModified(TRUE), but couldn't get it to work, the Apply button still disable.

Post your code.
0
 
recceAuthor Commented:
Thanks a lot.
0
All Courses

From novice to tech pro — start learning today.