Reputation: 2470
I am working in windows form and have a few textboxes
on a form.
These textboxes from top to bottom are connected, so if the text changes in textbox1
, then txtbox2
and txtbox3
have to comply, if something changes in textbox2
then 3 has to comply;... and so on ... not going to bore you.
Now I was looking for an alternative, more efficient way of calling the textchanged event
on the textboxes so it doesn't do everything everytime, even if one charater has changed....
Something like focus off textbox event ... or some other alternative .
This would be in vb.net and windows form.
Upvotes: 0
Views: 2227
Reputation: 20575
You can use the TextBox.LostFocus
event inherited from Control.LostFocus
.
This event is fired when the control looses focus, like Tab or clicked on another control.
Upvotes: 2
Reputation: 1725
TextBox1.LostFocus perhaps? Or enable validation on the controls.
Control focus event order: http://msdn.microsoft.com/en-gb/library/system.windows.forms.control.lostfocus.aspx
CausesValidation:
http://msdn.microsoft.com/en-gb/library/system.windows.forms.control.causesvalidation.aspx
Upvotes: 0