codice:
Private Sub MiaSubRoutine(devi avere la stessa firma dell'evento che vuoi gestire) Handles Textbox1.Evento, Textbox2.Evento, ... , TexboxN.Evento
End Sub
se devi usare una proprietà puoi fare un ciclo nel contenitore:
se per esempio le textbox si trovano in un form:
codice:
Dim myText as Control
For Each myText in myForm.Controls
If TypeOf(myText) Is TextBox then
myText.Text="TEST"
End If
Next
a volte devi fare una conversione esplicita del tipo, a seconda del controllo che usi:
codice:
Dim myText as Control
For Each myText in myForm.Controls
If TypeOf(myText) Is TextBox then
CType(myText, TextBox).Text="TEST"
End If
Next