Archived

This topic is now archived and is closed to further replies.

PropertySheets :: MFC

This topic is 5621 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
- 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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites