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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.