I am trying to perform input validation on a textbox. I was hoping to alert the user as soon as an invalid character has been entered. I have been frustrated using the OnKeyPress and OnKeyDown events, so I am considering a new tack: full field validation.
My questions are two. First, does a good discussion of keystroke-validation exist? I understand that the OnKeyPress event does not trap control characters; since I need to handle the Delete key, OnKeyPress is not useful.
Second, when does the textbox receive its value? What event is most appropriate to check -- OnDirty, OnExit, OnLostFocus, ...? I have tried to read the value in an OnExit procedure after at least two keystroke have been submitted. Still, the control behaves as if it does not yet have a value.
Thanks in advance for your assistance.
My questions are two. First, does a good discussion of keystroke-validation exist? I understand that the OnKeyPress event does not trap control characters; since I need to handle the Delete key, OnKeyPress is not useful.
Second, when does the textbox receive its value? What event is most appropriate to check -- OnDirty, OnExit, OnLostFocus, ...? I have tried to read the value in an OnExit procedure after at least two keystroke have been submitted. Still, the control behaves as if it does not yet have a value.
Thanks in advance for your assistance.