I have a form with ~70 textboxes, and I would like to add a sub to run whenever one of then gets focus. I have:
For Each tb In Me.Controls
If TypeOf tb Is TextBox Then
AddHandler tb.GotFocus, AddressOf tb_gotfocus
End If
Next
but it says "'GotFocus' is not an event of 'Object'". How do i do this en masse like this so it works? thanks.
For Each tb In Me.Controls
If TypeOf tb Is TextBox Then
AddHandler tb.GotFocus, AddressOf tb_gotfocus
End If
Next
but it says "'GotFocus' is not an event of 'Object'". How do i do this en masse like this so it works? thanks.