473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

XP System Colours

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
Nov 30 '05 #1
3 1231
"..:: Kevin ::.." <Ke***@discussions.microsoft.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 30 '05 #2
Thanks for your quick response, i'll look into doing that
Nov 30 '05 #3
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
"..:: Kevin ::.." <Ke***@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
| 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
Nov 30 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Els | last post by:
Hi, I would like an opinion on the following: I have a page which is made up of background-images with transparent linked images in front of it, which on hover show text in CSS popups. Due to...
3
by: CSX | last post by:
Hi I have just loaded Visual Basic.Net. I find the interfact colours very drab, especially compared to Office 2003. How do I change the interface colours (currently greys & white) Ta Carlo
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
8
by: Doug Laidlaw | last post by:
I tried to grab an image from a Web page the other day. It turned out that the page was made up of three horizontal bands, and part of the image was in each. One band was a JPEG, another was a...
2
by: Phil Stanton | last post by:
When designing a new form or report, the Default ForeColor is often something like -2147483640 which is the colour of Windows text (possibly black) and the default backColor is -2147483643...
4
by: Tim Marshall | last post by:
The report indicated in the send object command below has various colours in it which show nicely when the report is previewed and printed. However, when sent as an attachment to users without...
2
by: Alvo von Cossel I | last post by:
hi, i have a richtextbox in a form and its backcolor property is set a system color (i cannot remember the name) which varies according to the windows xp style e.g. olive green. when the textbox...
2
by: S Shulman | last post by:
Hi I can I retrieve the actual colour of the user's system colours but not by checking the actual value of e.g. a form to find out the colour of the system control just directly from the system...
1
by: leenadiwan | last post by:
Hi All!! We are doing a POC currently wherein we need to get the System colours in the JSP file. Example: If user has set a specific theme, we want to be able to get the theme details through...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.