Change Text Box Color When Typed In
This code should do the trick.
Private Sub TextBox1_LostFocus()
If TextBox1.Value < "" Then
TextBox1.BackColor = RGB(255, 255, 255)
Else:
TextBox1.BackColor = RGB(255, 255, 0)
End If
End Sub
HTH,
Elkar
"Paperback Writer" wrote:
Is it possible for a text box to be one color when blank, but change to
another color when the user types something into it?
When it's blank, I want it to be yellow.
After the user types in it, I want it to change to white.
Thoughts?
|