PropertySheets :: MFC
Hi.
I have a propertysheet with a multiple propertypages. I would like get two functions working.
1) enable/disable default buttons (IDOK, IDCANCEL, ID_APPLY_NOW) in the propertypage.
2) be notified when the user navigate to and from different propertypage. If possible set the active propertypage programmically.
Okay. I believe this is the way to enable/disable the default buttons of a propertysheet from within the propertysheet.
-----
// disable the OK button
GetDlgItem(IDOK)->EnableWindow(FALSE);
-----
However, the code above does not work from within a propertypage. Is there a way to accomplish the above without sending a message to main frame?
I have no idea on what message to catch as the user navigates to and from propertypages.
Thanks,
Kuphryn
- you can enable/disable the apply button easily:just call SetModified(TRUE)
- Enabling/disabling the OK and CANCEL button can be achieved as you tried. But instead of using IDOK, use spy++ to find out the real ids of these buttons. That should be enough.
- to set the property page programmatically, just use SetActivePage( index) in the propertysheet.
Hope it is useful.
Daniel.
- Enabling/disabling the OK and CANCEL button can be achieved as you tried. But instead of using IDOK, use spy++ to find out the real ids of these buttons. That should be enough.
- to set the property page programmatically, just use SetActivePage( index) in the propertysheet.
Hope it is useful.
Daniel.
The Ok/Cancel button probably belongs to the PropertySheet, so you can''t enable/disable it from the PropertyPage. If you had a pointer back to the parent PropertySheet you could probably rig something up.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement