473,473 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

"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 1833
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.