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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

chensuCommented:
CMyPropertySheet mySheet;

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

mySheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;

mySheet.DoModal();
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.