applying a theme color to a control

  • Thread starter Thread starter AussieRules
  • Start date Start date
A

AussieRules

Hi,

In XP you can set color schemes (olive green, silver, default blue).

I have some controls(panels) on my form, and I would like to set the color
as per the color of the scheme.

Can this be done ?
 
Hi,

In XP you can set color schemes (olive green, silver, default blue).

I have some controls(panels) on my form, and I would like to set the color
as per the color of the scheme.

Can this be done ?

You should have access automatically if you use the
System.Drawing.SystemBrushes and System.Drawing.SystemColors
enumerations instead of hard-coded colours.
 
Hi, using the SystemColors class you can get the colors that are assigned to
certain system components, eg

SystemColors.Control gets the color assigned to controls, e.g. buttons and
whatnot.
SystemColors.Highlight gets the color assigned to highlighting.

There's also a SystemBrushes and SystemPens class, that lets you get the
appropriate object associated with the color.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
 
* "AussieRules said:
In XP you can set color schemes (olive green, silver, default blue).

I have some controls(panels) on my form, and I would like to set the color
as per the color of the scheme.

You will have to use pinvoke on 'GetThemeColor'.
 
Back
Top