I have a form with seven textboxes, all describing different attributes of a used car. In the shared LostFocus event of my textboxes, I need a case statement which determines the particular TextBox that lost focus. I then need to perform different various tasks, but I don’t think they matter to my question.
How can I tell which textbox lost focus in my shared LostFocus event handler?
Select Case ________???
You can do one of two things.
The first is to select on the name
The second is what I prefer to do, it is to use the Tag property of the TextBox and put an unique number in it. So in that case your Select statement would look like.
The other thing that you mentioned was how to make sure of which TextBox lost its focus. There is a LostFocus Event you can Handle also in addition to the Leave event you are handling now.