Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to Prevent validation in KillFocus() of Edit box

Posted on 1999-07-11
Medium Priority
Last Modified: 2013-11-20
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 ??
Question by:rupak_khurana
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 23

Accepted Solution

chensu earned 200 total points
ID: 1309508
The validation should be done in the CPropertyPage::OnKillActive. See the MFC documentation for more information.

Expert Comment

ID: 1309509
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.


Author Comment

ID: 1309510
Thanks ! thats what i was looking for

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question