VB Generic Event Handlers

  • Thread starter Thread starter Dave Cousineau
  • Start date Start date
D

Dave Cousineau

im using VB.NET and i am creating an array of textboxes

i want to handle a LostFocus event for any of the
textboxes that i might create (at runtime), so that when
the user enters a value into the box i can pop the value
into my object when they leave the box. but i dont know
can i set up a custom LostFocus handler that all my run-
time created textboxes use together?
 
Hi,

Add a lostfocus event for one of the textboxes. After the handles
clause list the other textboxes lostfocus events.

Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox1.LostFocus, TextBox2.LostFocus,
TextBox3.LostFocus

End Sub

Ken
 
Back
Top