Click to See Complete Forum and Search --> : CPropertySheet Button Messages


-=SKULK=-
April 26th, 1999, 04:56 PM
Hi
Does anyone know how to get the APPLY and OK button messages on a property sheet, and is there any possibility to activate th APPLY button on any change of the pages
thanx for help.


--
-=SKULK=-

ValerieB
April 26th, 1999, 07:11 PM
To handle the mesages, just add to each of your CPropertyPage derived classes add the following handlers with the ClassWizard:

OnApply()
OnOK()

As for making the Apply button active... I assume that you have some sort of handler function that gets called whenever the user changes the state or contents of each UI widget on your dialog, right? Such as OnBnCLicked()? If not, then do it. :)

Once that's done, you need to add the following to each of those handlers:
SetModified(TRUE);

This will cause the Apply button to activate. Then, in your OnApply() handler, you call SetModified(FALSE); to make the button inactive.

Good luck, and happy coding!

Valerie Bradley
http://www.synthcom.com/~val
val@synthcom.com