Use AddHandler to add the common lostfocus event handler to all of your
textboxes.
Private Sub txtBoxLostFocus Handler(ByVal sender As Object, _
ByVal e As System.EventArg s)
End Sub
AddHandler TextBox1.LostFo cus, AddressOf txtBoxLostFocus Handler
AddHandler TextBox2.LostFo cus, AddressOf txtBoxLostFocus Handler
....
....
Also, if you are using the same lost focus event handler for all of the
textboxes on your form (or some other container such as a panel, tab page,
etc), you can do this within a loop:
' replace Me with whatever container you have your controls on
For Each txtBox As TextBox In Me.Controls
AddHandler txtBox.LostFocu s, AddressOf txtBoxLostFocus Handler
Next txtBox
hope that helps..
Imran.
"Bernard Bourée" <be*****@bouree .net> wrote in message
news:ed******** ******@TK2MSFTN GP14.phx.gbl...
I have some TextBoxes created by code.
I want to write a procedure to handle the lost of focus of any of these
TextBox.
How should I do that ?
Thanks
--
Bernard Bourée
be*****@bouree. net