Validating control content when loosing focus
-
Actually I have been programming for quit som years, but everytime I have to validate a control when I leave it I do some trial and error exploring. I like to know if somebody can tell me, whats the right strategi for doing this. Jørgen Granborg Jørgen Granbborg
-
Actually I have been programming for quit som years, but everytime I have to validate a control when I leave it I do some trial and error exploring. I like to know if somebody can tell me, whats the right strategi for doing this. Jørgen Granborg Jørgen Granbborg
How about the
WM_KILLFOCUS
message?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
How about the
WM_KILLFOCUS
message?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
Right so long so good, but how do I know where the focus vil go. If the user close the dialog or exit or switch to some other program, then I dont want to validate.
If the user dismisses the dialog, or switches to some other window, you don't need to validate any of the controls. The OK button should not be enabled until each control contains valid data.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
Actually I have been programming for quit som years, but everytime I have to validate a control when I leave it I do some trial and error exploring. I like to know if somebody can tell me, whats the right strategi for doing this. Jørgen Granborg Jørgen Granbborg
JGranborg wrote: Validating control content when loosing focus Be careful :) If two fields depend on each other, you can get into an infinite loop where the user can't leave the field they're editing. I've experienced this before and it's very frustrating :mad:
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"