Monday, December 05, 2005

LostFocus = Crap?

I discovered something interesting with the LostFocus method. Leaving a feild by clicking out of it does not always fire the LostFocus event. The reason for this (from my understanding) is that if the control runs through validation the CancelEventArgs object is set to true. This causes all events after it (in this case LostFocus) to not be fired.

In order to work around this use the Leave, Validating, or Validated events.


Post a Comment

<< Home