4
Contributors
3
Replies
8
Views
11 Years
Discussion Span
Last Post by Luc001
0

Try this:

Private Sub ChangeBackcolorRed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.MouseEnter, TextBox2.MouseEnter, TextBox3.MouseEnter
        sender.backcolor = Color.Blue
    End Sub

    Private Sub ChangeBackcolorWhite(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.MouseLeave, TextBox2.MouseLeave, TextBox3.MouseLeave
        sender.backcolor = Color.White
    End Sub
0

VB.NET Syntax (Toggle Plain Text)
Private Sub ChangeBackcolorRed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Enter, TextBox2.Enter, TextBox3.Enter
sender.backcolor = Color.Blue
End Sub

Private Sub ChangeBackcolorWhite(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Leave, TextBox2.Leave, TextBox3.Leave
sender.backcolor = Color.White
End Sub

0

Hi,

@waynespangler, your code is working with mouseEnter and MouseLeave, but the OP wants to change the backcolor when Tabstop set the focus on the textbox.

@Gopinathv Welkom to the Forum :icon_smile:

Edited by Luc001: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.