Or a little cleaner
Private Sub FocusChanged(sender As Object, e As EventArgs)
If CType(sender, TextBox).Focused Then
CType(sender, TextBox).BackColor = Color.FromArgb(65, 65, 65)
Else
CType(sender, TextBox).BackColor = Color.FromArgb(60, 60, 60)
End If
End Sub
or
Private Sub FocusChanged(sender As Object, e As EventArgs)
If sender.Focused Then
sender.Tag = sender.BackColor
sender.BackColor = Color.LightGray
Else
sender.BackColor = sender.Tag
End If
End Sub
Which saves the current background colour before setting the focused colour (useful if not all of your textboxes are the same colour). If you are a purist you can do
Private Sub FocusChanged(sender As Object, e As EventArgs)
Dim txt As TextBox = sender
If txt.Focused Then
txt.Tag = txt.BackColor
txt.BackColor = Color.LightGray
Else
txt.BackColor = txt.Tag
End If
End Sub