I am writing a GUI that requires validating a textbox when it loses focus. For that I am using the Validating Event Handler. However, if the user clicks the cancel button on the form, I need to prevent that textbox's validation event from firing.
I prefer to use the validating event, since that would validate the data the moment the user tabs out of the textbox.
I looked up info on the situation and found that the textbox's validating event gets fired before the cancel button's Enter event gets fired.
I need an answer to this rather soon, so if anyone can offer any advice, I would greatly appreciate it! Thanks!
How can I make sure it is the cancel button being hit before I validate, so that I will know whether I need to validate the text in the textbox or not?
I prefer to use the validating event, since that would validate the data the moment the user tabs out of the textbox.
I looked up info on the situation and found that the textbox's validating event gets fired before the cancel button's Enter event gets fired.
I need an answer to this rather soon, so if anyone can offer any advice, I would greatly appreciate it! Thanks!
How can I make sure it is the cancel button being hit before I validate, so that I will know whether I need to validate the text in the textbox or not?