standard way of getting color # string from drawing.color?

P

PJ6

I can't find any built-in way to do this. I'm assigning an HTML cell a
bgcolor and want to do it from a real color FromArgb... how do I get the #
string to assign it to the HTML cell? Or do I have to code a translator up
myself?

TIA,
Paul
 
S

S. Justin Gengo

Paul,

I was re-reading and realized that you may have also meant you want the full
conversion to a html table cell color. That's like this:

Dim ColorTranslator As System.Drawing.ColorTranslator

Dim HtmlColor As String = ColorTranslator.ToHtml(System.Drawing.Color.Red)

If you are using a server side control for your table. Then you'll be able
to assign the color with the method I showed you previously. If you want the
actual RGB color (i.e. #FFFFFF) Then that's the code above.


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
S. Justin Gengo said:
Paul,

System.Drawing.Color.FromArgb([argb color here])


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
PJ6 said:
I can't find any built-in way to do this. I'm assigning an HTML cell a
bgcolor and want to do it from a real color FromArgb... how do I get the #
string to assign it to the HTML cell? Or do I have to code a translator up
myself?

TIA,
Paul
 
P

PJ6

Why don't you read my question again.

Paul

S. Justin Gengo said:
Paul,

System.Drawing.Color.FromArgb([argb color here])


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
PJ6 said:
I can't find any built-in way to do this. I'm assigning an HTML cell a
bgcolor and want to do it from a real color FromArgb... how do I get the #
string to assign it to the HTML cell? Or do I have to code a translator up
myself?

TIA,
Paul
 
P

PJ6

Aha! I knew there was something built in.

Thanks,
Paul

S. Justin Gengo said:
Paul,

I was re-reading and realized that you may have also meant you want the
full conversion to a html table cell color. That's like this:

Dim ColorTranslator As System.Drawing.ColorTranslator

Dim HtmlColor As String = ColorTranslator.ToHtml(System.Drawing.Color.Red)

If you are using a server side control for your table. Then you'll be able
to assign the color with the method I showed you previously. If you want
the actual RGB color (i.e. #FFFFFF) Then that's the code above.


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
S. Justin Gengo said:
Paul,

System.Drawing.Color.FromArgb([argb color here])


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
PJ6 said:
I can't find any built-in way to do this. I'm assigning an HTML cell a
bgcolor and want to do it from a real color FromArgb... how do I get the
# string to assign it to the HTML cell? Or do I have to code a translator
up myself?

TIA,
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top