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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation of CEdit control

Status
Not open for further replies.

debugee

Programmer
Oct 10, 2002
3
0
0
MK
My problem is that i want to validate the contents of a CEdit control which is being created and destroyed, and i pop up a MessageBox if the contents of the CEdit is not the correct one. I validate it in KillFocus of the CEdit control which causes a second return in the KillFocus when the MessageBox pops up.
So if anybody has any ideas, please let me know.
Thanks
 
I normally do all validation for edit boxes when the user clicks OK - if anything is invalid, display a message box and do not call the CDialog::OnOK() so the dialog stays open.

If you want to validate as the user is typing, catch the keystrokes using the PreTranslateMessage() function.
 
Well I cannot check anything on th OnOk, cause I have to check (validate) the contents of the edit field when it looses focus (or when it is being destroyed).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top