TextBox > GotFocus

PROKA

Junior Contributor
Joined
Sep 3, 2003
Messages
249
Location
Bucharest
Visual Basic:
    Private Sub txtFrom_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtFrom.GotFocus
        txtStatus.Text = "TEST"
    End Sub

It doesn't work. It works for a combo box, not for the txtFrom textbox
 
I used your code and it worked fine. I created a text box called txtFrom and pasted your code in my form and I had no problems with it. I even made it change upon losing focus and that worked as well.

Code:
Private Sub txtFrom_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus
        TextBox1.Text = "FOCUSED"
    End Sub
Private Sub txtFrom1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
        TextBox1.Text = "NOT FOCUSED"
    End Sub
 
Back
Top