473,396 Members | 2,037 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,396 software developers and data experts.

"Background" not in KnownColors Enumeration

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
Nov 22 '05 #1
4 1832
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/de...classtopic.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

"Charles Law" <bl**@thingummy.com> wrote in message
news:#b*************@TK2MSFTNGP10.phx.gbl...
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

Nov 22 '05 #2
Thanks for the response Richard. I will have a look at the API.

Charles
"Richard Burte" <rb****@online.microsoft.com> wrote in message
news:ek**************@tk2msftngp13.phx.gbl...
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/de...classtopic.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

"Charles Law" <bl**@thingummy.com> wrote in message
news:#b*************@TK2MSFTNGP10.phx.gbl...
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


Nov 22 '05 #3
There is a managed collection that returns this information -
System.Drawing.SystemColors
"Charles Law" <bl**@thingummy.com> wrote in message
news:uI**************@TK2MSFTNGP10.phx.gbl...
Thanks for the response Richard. I will have a look at the API.

Charles
"Richard Burte" <rb****@online.microsoft.com> wrote in message
news:ek**************@tk2msftngp13.phx.gbl...
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/de...classtopic.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

"Charles Law" <bl**@thingummy.com> wrote in message
news:#b*************@TK2MSFTNGP10.phx.gbl...
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



Nov 22 '05 #4
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
"Richard Burte" <rb****@online.microsoft.com> wrote in message
news:ex**************@tk2msftngp13.phx.gbl...
There is a managed collection that returns this information -
System.Drawing.SystemColors
"Charles Law" <bl**@thingummy.com> wrote in message
news:uI**************@TK2MSFTNGP10.phx.gbl...
Thanks for the response Richard. I will have a look at the API.

Charles
"Richard Burte" <rb****@online.microsoft.com> wrote in message
news:ek**************@tk2msftngp13.phx.gbl...
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/de...classtopic.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

"Charles Law" <bl**@thingummy.com> wrote in message
news:#b*************@TK2MSFTNGP10.phx.gbl...
> 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
>
>



Nov 22 '05 #5

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

Similar topics

17
by: Torbjørn Pettersen | last post by:
I've got a table where I want some of the cells to use a background image. The cells have variable height, so I am using an image with a rather small height to fill up the background of the cells,...
4
by: Charles Law | last post by:
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,...
2
by: Just D. | last post by:
Who knows what should we include into aspx file to show some image as a background picture but only once at the top of the page? I don't want to add the Image control because even if it uses a...
8
by: Maxwell2006 | last post by:
Hi, Using ASP.NET 2.0, I have this tag in my asp page: <td runat =server background="~/Images/Header2.gif">&nbsp;</td> The problem is when I run the page, the server side TD tag renders...
3
by: bulwark_jrm | last post by:
I'm trying to duplicate functionality found in a Windows application at one of my clients. Essentially, another programmer was able to arrange a lot of search options into a single dialog box by...
2
by: soulmach | last post by:
Hello forum friends. I performed a search on this topic, but I couldn't find anything useful. I wasn't really sure what to search. First I'll state what I am trying to do. I recently agreed to...
1
by: Miggiddy79 | last post by:
Does any body know how to fix this. I am trying to validate these html codes through the markup validation. I have 5 error messages: 1) Line 114, Column 15: there is no attribute "BACKGROUND" ....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.