Label color

  • Thread starter Edward van Nijmweegen
  • Start date
E

Edward van Nijmweegen

Hi,

I think it's a dumb question. How can i change the front color of a label
field out of asp.net.

I mean, when someone select a value, the color of a label has to change
from black to red.

I tried lblName.forecolor = "#00000" but it didn't work.

Thanks,

Edward
 
S

Scott M.

ForeColor is the correct property. If it is not working, it's because of
something else.
 
K

Ken Cox [Microsoft MVP]

Hi Edward,

ForeColor is looking for a system.drawing.color object, not a string.

Try this?

lblName.ForeColor =
System.Drawing.ColorTranslator.FromHtml("#ff0000")

Ken
Microsoft MVP [ASP.NET]
 
S

Scott M.

or lblName.ForeColor = Color.Red


Ken Cox said:
Hi Edward,

ForeColor is looking for a system.drawing.color object, not a string.

Try this?

lblName.ForeColor =
System.Drawing.ColorTranslator.FromHtml("#ff0000")

Ken
Microsoft MVP [ASP.NET]


Edward van Nijmweegen said:
Hi,

I think it's a dumb question. How can i change the front color of a label
field out of asp.net.

I mean, when someone select a value, the color of a label has to change
from black to red.

I tried lblName.forecolor = "#00000" but it didn't work.

Thanks,

Edward
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top