G
Guest
Hello,
Here is my solution below that works but can be improved upon. The
improvement that I seek is how to define the handler that handles the txt1
and txt2 controls in an automated fashion. If I add three more textboxes to
my winform, I do not want to have to change the hadler evertime I make
changes.
Private txtColor As Color = Color.LightSkyBlue
Private txtOrig As Color
Private Sub HighLight(ByVal Sender As Object, ByVal e As EventArgs) Handles
txt1.Enter, txt2.Enter
txtOrig = DirectCast(Sender, TextBox).BackColor()
DirectCast(Sender, TextBox).BackColor = txtColor
End Sub
Private Sub LowLight(ByVal Sender As Object, ByVal e As EventArgs) Handles
txt1.Leave, txt2.Leave
DirectCast(Sender, TextBox).BackColor = txtOrig
End Sub
Thanks in Advance!
Joseph
Here is my solution below that works but can be improved upon. The
improvement that I seek is how to define the handler that handles the txt1
and txt2 controls in an automated fashion. If I add three more textboxes to
my winform, I do not want to have to change the hadler evertime I make
changes.
Private txtColor As Color = Color.LightSkyBlue
Private txtOrig As Color
Private Sub HighLight(ByVal Sender As Object, ByVal e As EventArgs) Handles
txt1.Enter, txt2.Enter
txtOrig = DirectCast(Sender, TextBox).BackColor()
DirectCast(Sender, TextBox).BackColor = txtColor
End Sub
Private Sub LowLight(ByVal Sender As Object, ByVal e As EventArgs) Handles
txt1.Leave, txt2.Leave
DirectCast(Sender, TextBox).BackColor = txtOrig
End Sub
Thanks in Advance!
Joseph