How to Prevent validation in KillFocus() of Edit box

I have a property sheet with 4 property pages. On one of the pages, there is an edit box whcih does some validation in its KillFocus() method. The problem is that if I put wrong enteries into that edit box and now I want to discard that changes and press Cancel button, It still validates since KillFocus() of edit box is being called when i click on Cancel button. It wont let me quit gracefully unless i feed that edit box with good food !! How do I prevent this ??
Who is Participating?
chensuConnect With a Mentor Commented:
The validation should be done in the CPropertyPage::OnKillActive. See the MFC documentation for more information.
At work I use OnParentNotify (using CDialogs, not prop sheets) catching the click for the button, however, I think you may want to try PreTransalteMessage.

rupak_khuranaAuthor Commented:
Thanks ! thats what i was looking for
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.