how to find out which textbox is currenlty selected.
- by abcdefghijklmnopqrstuvwxyz
I have 3 text-boxes, how do I find out which text-box is currently selected (has focus). I am unable to come up with anything.
Public Class Form1
Public activeTextBox As TextBox = CType(Me.ActiveControl, TextBox)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
activeTextBox.Text = activeTextBox.Text & "This is text 1"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
activeTextBox.Text = activeTextBox.Text & "This is the text 2"
End Sub
End Class