Link to home
Start Free TrialLog in
Avatar of recce
recce

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of recce
recce

ASKER

chensu, your code remove only the Apply button. The Help button still present.
Pls advice
Also, for each property page, remove the PSP_HASHELP flag for the dwFlags member of the PROPSHEETPAGE structure.
Avatar of recce

ASKER

chensu, please explain how to do that
For each page, do the following before calling AddPage.

CPropertyPage Page1;

Page1.Construct(ID_PAGE1);

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

AddPage(&Page1);
Avatar of recce

ASKER

chensu, please explain how to do that
Avatar of recce

ASKER

chensu, i tried but the HELP button still present.
Avatar of recce

ASKER

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.
>which method is called when the OK button is clicked.

CPropertyPage::OnOK
Avatar of recce

ASKER

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.
Avatar of recce

ASKER

Adjusted points to 150
Call CPropertyPage::SetModified to enable or disable the Apply Now button. And CPropertyPage::OnApply is called when the Apply Now button is clicked.
Avatar of recce

ASKER

but how to detect a change in any of the property pages so as to enable the Apply Button.
That has to be done by each property page. The property sheet does not know it.
Avatar of recce

ASKER

is there any property page method that detect if any of its controls changes state?
Avatar of recce

ASKER

I tried to use SetModified(TRUE), but couldn't get it to work, the Apply button still disable.
>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.
Avatar of recce

ASKER

Thanks a lot.