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

Color => string ?

I'm designing a web user control
it has a color property and I want to output in the HTML something like:

bgcolor=#FFDEAD

for this in the C# code I write(HtmlTextWriter output)

output.Write(" bgcolor={0}", BackColor);

but this doesn't work at all, my output is
bgcolor=Color [A=255, R=231, G=253, B=100]

how could I format the color value ?
I could build myself a number like that #123456 but the the default behavior
is nice, output a color name when it's a unique color, etc ....
how could I do that ?

please....
Nov 17 '05 #1
3 1280
merveilleux dirais-je meme !

"Andrew de la Harpe" <an*********@hotmail.com> a écrit dans le message de
news:%2****************@TK2MSFTNGP10.phx.gbl...
checkout the WebColorConverter class.
"Lloyd Dupont" <ll***@RemoveIfNotSpamming.galador.net> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
I'm designing a web user control
it has a color property and I want to output in the HTML something like:

bgcolor=#FFDEAD

for this in the C# code I write(HtmlTextWriter output)

output.Write(" bgcolor={0}", BackColor);

but this doesn't work at all, my output is
bgcolor=Color [A=255, R=231, G=253, B=100]

how could I format the color value ?
I could build myself a number like that #123456 but the the default

behavior
is nice, output a color name when it's a unique color, etc ....
how could I do that ?

please....


Nov 17 '05 #2
checkout the WebColorConverter class.
"Lloyd Dupont" <ll***@RemoveIfNotSpamming.galador.net> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
I'm designing a web user control
it has a color property and I want to output in the HTML something like:

bgcolor=#FFDEAD

for this in the C# code I write(HtmlTextWriter output)

output.Write(" bgcolor={0}", BackColor);

but this doesn't work at all, my output is
bgcolor=Color [A=255, R=231, G=253, B=100]

how could I format the color value ?
I could build myself a number like that #123456 but the the default behavior is nice, output a color name when it's a unique color, etc ....
how could I do that ?

please....

Nov 17 '05 #3
merveilleux dirais-je meme !

"Andrew de la Harpe" <an*********@hotmail.com> a écrit dans le message de
news:%2****************@TK2MSFTNGP10.phx.gbl...
checkout the WebColorConverter class.
"Lloyd Dupont" <ll***@RemoveIfNotSpamming.galador.net> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
I'm designing a web user control
it has a color property and I want to output in the HTML something like:

bgcolor=#FFDEAD

for this in the C# code I write(HtmlTextWriter output)

output.Write(" bgcolor={0}", BackColor);

but this doesn't work at all, my output is
bgcolor=Color [A=255, R=231, G=253, B=100]

how could I format the color value ?
I could build myself a number like that #123456 but the the default

behavior
is nice, output a color name when it's a unique color, etc ....
how could I do that ?

please....


Nov 17 '05 #4

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

Similar topics

1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
0
by: thomas | last post by:
I must be doing something obvious wrong here, but: I perform a query to retrieve a dataset - I want to archive this in a SQL field for seperate retrieval later, while the original data may have...
2
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all...
4
by: David Bargna | last post by:
Hi I have a problem, I have a string which needs to be converted to a byte array, then have the string representation of this array stored in an AD attribute. This string attribute then has to...
1
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all...
5
by: tjay | last post by:
Hi. I wrote some code using sprintf and atof to store a double as a string of fixed length and to convert it back to a double variable. The string is stored in a char buffer global variable. I'm...
5
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE"...
4
by: Christofer Dutz | last post by:
Hi, I am having a small problem, that is driving me nuts. My application reads some Xml and runs 2 Xsl Transformations to generate HTML. As soon as my second XSL introduces some <br/tags, the...
2
by: imonline | last post by:
Hi, I am generating XML and setting it into the string field. Which will be again generated into xml. Now the last xml which has xml in string field converts into "&gt" for the xml which is set...
2
by: alfarah | last post by:
how to wirte C program to calculate and print the number of different symbols used in a given string. A blank space counts as one symbol. Input: Any string. The length is limited to 60 characters....
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...
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
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
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.