XP System Colours

G

Guest

Hello,

Is it possible to pick up the colour values used in the XP themes from
within .net? I am wanting to set the back colour of one of my forms to the
light shade of the theme I am using.

For example, currently I am running the default blue windows XP theme and im
trying to set my form to the light shade of blue that the system uses (its
the shade that appears at the far right of menu bars with gradients, like the
one in Word). I could hard code the RGB values of this colour into my app,
however if I change to a different theme (olive green for example) then my
form is still going to be showing blue.

I have tried looking in the SystemColors class in .net but it doesnt seem to
have the values for these colours? Is there an API I can call to get this
information or am I looking in the wrong place in .net?

Thanks for any help

Kevin
 
H

Herfried K. Wagner [MVP]

..:: Kevin ::.. said:
Is it possible to pick up the colour values used in the XP themes from
within .net? I am wanting to set the back colour of one of my forms to
the
light shade of the theme I am using.

..NET doesn't provide classes to determine these colors. You could use
p/invoke with 'GetThemeColor' ("uxtheme.dll") to determine the color of a
certain theme part.
 
J

Jay B. Harlow [MVP - Outlook]

Kevin,
In addition to the other comments, I understand the new
System.Windows.Forms.VisualStyles namespace in .NET 2.0 exposes the XP Theme
information to your app.

http://msdn2.microsoft.com/aafwxf9c(en-US,VS.80).aspx

Unfortunately I have not used VisualStyles enough to give you an example of
what you need.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| Hello,
|
| Is it possible to pick up the colour values used in the XP themes from
| within .net? I am wanting to set the back colour of one of my forms to
the
| light shade of the theme I am using.
|
| For example, currently I am running the default blue windows XP theme and
im
| trying to set my form to the light shade of blue that the system uses (its
| the shade that appears at the far right of menu bars with gradients, like
the
| one in Word). I could hard code the RGB values of this colour into my
app,
| however if I change to a different theme (olive green for example) then my
| form is still going to be showing blue.
|
| I have tried looking in the SystemColors class in .net but it doesnt seem
to
| have the values for these colours? Is there an API I can call to get this
| information or am I looking in the wrong place in .net?
|
| Thanks for any help
|
| Kevin
 

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

Similar Threads

Excel How to change lines in graph to individual colours 0
Themes 7
XP Theme Colours 2
transparent colours for images 2
Need help with colors. 4
How to change window border colours? 1
Get the system colours 2
Theme / Scheme 4

Top