Hi
Here is some code that may help.
The code in the Form Load event assigns all the TextBoxes in Panel1 ENTER EVENT to the same Sub (TextBox_Enter)
I chose the Enter Event as the GotFocus fires for all TextBoxes if the Panel was obscured by (say) another window and then made visible again.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' This is maybe what you want - this will
' add all TextBoxes in Panel1 Enter event
' to the same Handler
For Each c As Control In Panel1.Controls
If c.GetType = GetType(TextBox) Then
AddHandler c.Enter, AddressOf TextBox_Enter
End If
Next
End Sub
Private Sub TextBox_Enter(sender As Object, e As EventArgs)
' Handles all Panel1 TextBoxes Enter Event
Dim tb As TextBox = DirectCast(sender, TextBox)
tb.SelectAll()
End Sub