Label color

Discussion in 'ASP .Net Web Controls' started by Edward van Nijmweegen, Jan 18, 2005.

  1. 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
    Edward van Nijmweegen, Jan 18, 2005
    #1
    1. Advertising

  2. Edward van Nijmweegen

    Scott M. Guest

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

    "Edward van Nijmweegen" <> wrote in message
    news:1wds3c04vorok.zdlme80wpgpw$...
    > 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
    Scott M., Jan 18, 2005
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:1wds3c04vorok.zdlme80wpgpw$...
    > 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
    Ken Cox [Microsoft MVP], Jan 18, 2005
    #3
  4. Edward van Nijmweegen

    Scott M. Guest

    or lblName.ForeColor = Color.Red


    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:OK19hSY$...
    > 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" <> wrote in message
    > news:1wds3c04vorok.zdlme80wpgpw$...
    >> 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

    >
    Scott M., Jan 19, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shapper
    Replies:
    2
    Views:
    722
    Scott Mitchell [MVP]
    May 7, 2005
  2. Josef K.

    <label><div></div></label> allowed?

    Josef K., May 20, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    13,305
    Josef K.
    May 22, 2005
  3. Praveen
    Replies:
    1
    Views:
    945
    Rob Williscroft
    Nov 5, 2006
  4. Kamaljeet Saini
    Replies:
    0
    Views:
    386
    Kamaljeet Saini
    Feb 13, 2009
  5. Knut Krueger
    Replies:
    8
    Views:
    254
    Knut Krueger
    Aug 20, 2013
Loading...

Share This Page