Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do not destroy the property sheet when clicking OK

Status
Not open for further replies.

kshea

Technical User
May 31, 2002
60
CA
Hi Everyone:

In a property sheet, when user clicked the OK button to exit the property sheet, I prompt a dialog to let user reenter the information in the notification message PSN_APPLY. After closed dialog, how can I keep the property sheet on instead of destroying it? (That is, acting like clicked Apply button)

Thanks in advance.
 
I guess you've overloaded the
Code:
OnOK()
function of the property sheet to make it launch the dialog? If so, then just don't call
Code:
Base_class::OnOK()
because this is where the sheet gets closed.
This call will be at the end of the function -
Code:
Base_class
might be
Code:
CDialog
or similar.
 
I find the solution. I did not use MFC anyway.

In the form of a WM_NOTIFY message, sent PSN_APPLY notification, Set the return value to PSNRET_INVALID_NOCHANGEPAGE or PSNRET_INVALID to indicate that the changes made to this page are invalid and the property sheet will not be destroyed. Otherwise, Set PSNRET_NOERROR to indicate changes made to this page are valid and have been applied.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top