views:

178

answers:

2

I am trying to get a specific colour used by Windows XP in my .NET application.

In Windows XP, if you go the Control Panel in 'category view', on the left hand side you have some 'See Also' options (Windows Update, Help and Support, Other Control Panel Options). The colour I'm trying to get is the light blue background colour shown behind these options.

I don't need the hex/RGB value of the colour, as it can change depending on the style settings used on the desktop.

My question is - is it possible to programmatically get hold of this colour in a .NET app?

The colour doesn't appear to be in SystemColors, although it's very similar to SystemColors.InactiveCaptionText (and I think I can probably get away with using this). I'm just wondering if there is a way to get hold of the exact colour.

+1  A: 

Quick guess: Google "VisualStyles.dll" and maybe there's a hint in the source of http://www.codeproject.com/KB/miscctrl/ThemedExplorerControls.aspx?display=Print

tamberg
Thanks, I think I need to go and learn about 'Themes'...
+2  A: 

Thanks for the hint tamberg

I found the answer I needed in System.Windows.Forms.VisualStyles

I used a VisualStyleRenderer to draw the colour I needed.

If anyone is interested, the colour I was after was the VisualStyleElement.ExplorerBar.NormalGroupBackground. See msdn page

+1 Good job to have found your answer.
Daok