VB 2008.
I have several text boxes on a form and I want each of them to use the same event handler. I know how to manually wire each one up to the handler, but I'm looking for a more generic way so if I add more text boxes they will automatically be hooked up to the event handler.
Ideas?
EDIT: Using the C# sample from MusiGenesis (and with the help of the comment left by nick), I wrote this VB code:
Private Sub AssociateTextboxEventHandler()
For Each c As Control In Me.Controls
If TypeOf c Is TextBox Then
AddHandler c.TextChanged, AddressOf tb_TextChanged
End If
Next
End Sub
Thanks a lot! SO is great.