473,378 Members | 1,496 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,378 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 3665
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.