Richard Brennan

Richard Brennan

  • NA
  • 114
  • 85.4k

Im using the leave event of a text box

Apr 13 2011 9:56 AM
I am using the leave event of a text box to validate a username and password - the problem is if the user has started to enter data in the text box and they decide to press the cancel button - the leave event on the text box does not need calling. Is there a way to stop the leave event happening if the cancel button is pressed. can I use the 'try and catch' thing and check if the click event on cancel has happened? If so can some on explain try catch as i have never used it.  Like what is optional and compulsory and how the logic flows through it?


---------------------
Solved it like this

if (!btnChangePasswordCancel.Focused) [this is inside the leave event]
  dont validate the text

Answers (7)