473,396 Members | 1,968 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.

SystemColor 'Control' to 'buttonface'

Ade
Hello, i've noticed that some old system colors have been left out of the
current version of the .net framework, including ButtonFace,
ButtonHighlight & ButtonShadow. It seems these have been replaced by
Control, ControlLight & ControlDark.

The one i'm particularly interested in is Control which when rendered to the
browser is actually output as buttonface. I need to be able to set the color
(in the style attribute of the html) of a custom control on the server side
at runtime and want to be able to convert the system color 'Control' to
'buttonface'. I figure there must be some easy way of doing this but i'm
damned if i can find it.

Anybody, any ideas?

regards,
Ade.
Nov 18 '05 #1
2 3667
Ade
Aha! Classic case of posting too soon.

Anyway, if anybody else is looking for the answer to this, you can use the
ColorTranslator class which has a ToHtml method, e.g.

System.Drawing.Color = System.Drawing.SystemColors.Control;

string htmlColor = ColorTranslator.ToHtml(color);

which will return 'buttonface'

:)

Ade.

-----------------------------------------------------------------

"Ade" <no********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello, i've noticed that some old system colors have been left out of the
current version of the .net framework, including ButtonFace,
ButtonHighlight & ButtonShadow. It seems these have been replaced by
Control, ControlLight & ControlDark.

The one i'm particularly interested in is Control which when rendered to the browser is actually output as buttonface. I need to be able to set the color (in the style attribute of the html) of a custom control on the server side at runtime and want to be able to convert the system color 'Control' to
'buttonface'. I figure there must be some easy way of doing this but i'm
damned if i can find it.

Anybody, any ideas?

regards,
Ade.

Nov 18 '05 #2
of cource this will be the servers buttonface color, not the browsers.

-- bruce (sqlwork.com)

"Ade" <no********@hotmail.com> wrote in message
news:Ok**************@TK2MSFTNGP09.phx.gbl...
Aha! Classic case of posting too soon.

Anyway, if anybody else is looking for the answer to this, you can use the
ColorTranslator class which has a ToHtml method, e.g.

System.Drawing.Color = System.Drawing.SystemColors.Control;

string htmlColor = ColorTranslator.ToHtml(color);

which will return 'buttonface'

:)

Ade.

-----------------------------------------------------------------

"Ade" <no********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello, i've noticed that some old system colors have been left out of the current version of the .net framework, including ButtonFace,
ButtonHighlight & ButtonShadow. It seems these have been replaced by
Control, ControlLight & ControlDark.

The one i'm particularly interested in is Control which when rendered to

the
browser is actually output as buttonface. I need to be able to set the

color
(in the style attribute of the html) of a custom control on the server

side
at runtime and want to be able to convert the system color 'Control' to
'buttonface'. I figure there must be some easy way of doing this but i'm
damned if i can find it.

Anybody, any ideas?

regards,
Ade.


Nov 18 '05 #3

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

Similar topics

0
by: Alex Molochnikov | last post by:
I am trying to globally change the value of one of SystemColor fields. Apparently, it is loaded from UIDefaults (this is largely a guessing game since there is almost no documenation available) and...
0
by: Greg Christie | last post by:
I think I have a somewhat unique situation here, so I thought I should post it for the few poor souls who run across it and try to google it like I did. First of all, I was getting the following...
1
by: Pino Carafa | last post by:
I've designed an aspx page with a Tab Strip on it. The problem is that unlike some of the simpler controls like text boxes and buttons and the likes, this Tab Strip is rendered something like this:...
6
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get...
2
by: Ade | last post by:
Hello, i've noticed that some old system colors have been left out of the current version of the .net framework, including ButtonFace, ButtonHighlight & ButtonShadow. It seems these have been...
1
by: Jack Black | last post by:
Hey, all! Looking for a source for 16x16 icons with the XP buttonface color that can be used for basic toolbars?? The ones that come with VB.Net (VS.Net '03) don't have the XP buttonface color......
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
2
by: aarepasky | last post by:
I am using ASP Web 2005 express and I have a textbox in a user control. Now when I try to use it in another user control, I get the error that it "does not exist in current context. These 2 user...
10
by: aarepasky | last post by:
I am using ASP Web 2005 express. I created the user control below and I am listing the html code. I have 2 textboxes. One is txtCompanyName. The main page has 2 panels on it and a button. ...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.