SystemColor 'Control' to 'buttonface'

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ade

    SystemColor 'Control' to 'buttonface'

    Hello, i've noticed that some old system colors have been left out of the
    current version of the .net framework, including ButtonFace,
    ButtonHighlight & ButtonShadow. It seems these have been replaced by
    Control, ControlLight & ControlDark.

    The one i'm particularly interested in is Control which when rendered to the
    browser is actually output as buttonface. I need to be able to set the color
    (in the style attribute of the html) of a custom control on the server side
    at runtime and want to be able to convert the system color 'Control' to
    'buttonface'. I figure there must be some easy way of doing this but i'm
    damned if i can find it.

    Anybody, any ideas?

    regards,
    Ade.


  • Ade

    #2
    Re: SystemColor 'Control' to 'buttonface'

    Aha! Classic case of posting too soon.

    Anyway, if anybody else is looking for the answer to this, you can use the
    ColorTranslator class which has a ToHtml method, e.g.

    System.Drawing. Color = System.Drawing. SystemColors.Co ntrol;

    string htmlColor = ColorTranslator .ToHtml(color);

    which will return 'buttonface'

    :)

    Ade.

    -----------------------------------------------------------------

    "Ade" <notclectic@hot mail.com> wrote in message
    news:%23QbqsMrJ EHA.3120@TK2MSF TNGP11.phx.gbl. ..[color=blue]
    > Hello, i've noticed that some old system colors have been left out of the
    > current version of the .net framework, including ButtonFace,
    > ButtonHighlight & ButtonShadow. It seems these have been replaced by
    > Control, ControlLight & ControlDark.
    >
    > The one i'm particularly interested in is Control which when rendered to[/color]
    the[color=blue]
    > browser is actually output as buttonface. I need to be able to set the[/color]
    color[color=blue]
    > (in the style attribute of the html) of a custom control on the server[/color]
    side[color=blue]
    > at runtime and want to be able to convert the system color 'Control' to
    > 'buttonface'. I figure there must be some easy way of doing this but i'm
    > damned if i can find it.
    >
    > Anybody, any ideas?
    >
    > regards,
    > Ade.
    >
    >[/color]


    Comment

    • bruce barker

      #3
      Re: SystemColor 'Control' to 'buttonface'

      of cource this will be the servers buttonface color, not the browsers.

      -- bruce (sqlwork.com)



      "Ade" <notclectic@hot mail.com> wrote in message
      news:Okl#2TrJEH A.1388@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Aha! Classic case of posting too soon.
      >
      > Anyway, if anybody else is looking for the answer to this, you can use the
      > ColorTranslator class which has a ToHtml method, e.g.
      >
      > System.Drawing. Color = System.Drawing. SystemColors.Co ntrol;
      >
      > string htmlColor = ColorTranslator .ToHtml(color);
      >
      > which will return 'buttonface'
      >
      > :)
      >
      > Ade.
      >
      > -----------------------------------------------------------------
      >
      > "Ade" <notclectic@hot mail.com> wrote in message
      > news:%23QbqsMrJ EHA.3120@TK2MSF TNGP11.phx.gbl. ..[color=green]
      > > Hello, i've noticed that some old system colors have been left out of[/color][/color]
      the[color=blue][color=green]
      > > current version of the .net framework, including ButtonFace,
      > > ButtonHighlight & ButtonShadow. It seems these have been replaced by
      > > Control, ControlLight & ControlDark.
      > >
      > > The one i'm particularly interested in is Control which when rendered to[/color]
      > the[color=green]
      > > browser is actually output as buttonface. I need to be able to set the[/color]
      > color[color=green]
      > > (in the style attribute of the html) of a custom control on the server[/color]
      > side[color=green]
      > > at runtime and want to be able to convert the system color 'Control' to
      > > 'buttonface'. I figure there must be some easy way of doing this but i'm
      > > damned if i can find it.
      > >
      > > Anybody, any ideas?
      > >
      > > regards,
      > > Ade.
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...