"Background" not in KnownColors Enumeration

  • Thread starter Thread starter Charles Law
  • Start date Start date
C

Charles Law

When displaying the Color Picker for a web page (in the VS IDE), Background
is listed on the System Colors tab.

Also,

Color.FromName("Background").IsNamedColor

returns True.

However, Background is not a member of the SystemColors class, and it is not
a member of the KnownColors enum nor the Color structure.

Where can I find this named colour? I want to be able to enumerate all named
colours programmatically, but I cannot find this one (and one or two
others).

TIA

Charles
 
Seems that the IsNamedColor is checking the name attribute, rather than the
enumeration. IsKnownColor will work correctly. The enumeration is documented
at:

http://msdn.microsoft.com/library/d...ml/frlrfsystemdrawingknowncolorclasstopic.asp

and as you noted doesn't contain the Window Background color. I am going to
forward this to the product team. As a work around you may want to use the
Win32 API to investigate the system color palette.

Cheers,

Richard Burte
 
There is a managed collection that returns this information -
System.Drawing.SystemColors
 
Hi Richard

I have just looked at System.Drawing.SystemColors, but it does not appear to
contain a member "Background" on my m/c. Does it on yours? I am using VS2003
on Win2k SP4.

Charles
 
Back
Top