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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, for each property page, remove the PSP_HASHELP flag for the dwFlags member of the PROPSHEETPAGE structure.
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);
CPropertyPage Page1;
Page1.Construct(ID_PAGE1);
Page1.m_psp.dwFlags &= ~(PSP_HASHELP);
AddPage(&Page1);
ASKER
chensu, please explain how to do that
ASKER
chensu, i tried but the HELP button still present.
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.
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
CPropertyPage::OnOK
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.
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.
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.
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.
ASKER
is there any property page method that detect if any of its controls changes state?
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.
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.
ASKER
Thanks a lot.
ASKER
Pls advice