"Background" not in KnownColors Enumeration

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
 
R

Richard Burte

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
 
R

Richard Burte

There is a managed collection that returns this information -
System.Drawing.SystemColors
 
C

Charles Law

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
 

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

Top