Hey your solution will give you what you need. The only downfall I see to it is that you would need to manually add handles controlName.DoubleClick, controlName2.DoubleClick, ...
If you're looking to do this for all of the textboxes you could do something like this:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each tb As TextBox In Me.Controls AddHandler tb.DoubleClick, AddressOf MyDoubeClick Next End Sub Private Sub MyDoubeClick(ByVal sender As Object, ByVal e As System.EventArgs) 'your code here. End Sub
This would make MyDoubleClick handle the double click event for all* textboxes on the form. If you didn't want to handle the event for all you could make it a little more complex. You could check the .Name member of the textbox class and do some pattern matching on it. Check to see if the name matches "MyAiTextBox*" with code something like:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each tb As TextBox In Me.Controls If (tb.Name Like "MyAiTextBox*") Then _ AddHandler tb.DoubleClick, AddressOf MyDoubeClick Next End Sub Private Sub MyDoubeClick(ByVal sender As Object, ByVal e As System.EventArgs) End Sub
Anyway just a quick suggestion; good luck!
-Kyle