Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing label text color in code question 1

Status
Not open for further replies.

piratefan

Programmer
Jul 20, 2003
195
US
I am trying to change a label's text color. If the user enters invalid data, I want the label to appear in red. But I am exhausting my options.

Label1.forecolor = "red"
Label1.forecolor = red
etc.

I can't locate it with searches. And I have used it before.
Thanks.
 
Try this:
Code:
Label1.ForeColor=System.Drawing.Color.FromName("red")
 
Joulius --

You're not going to believe this, but you answer this thread, and the one I posted, just after this one; so you nailed 2 in a row. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top