473,385 Members | 1,673 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,385 software developers and data experts.

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

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
Nov 19 '05 #1
4 1569
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" <no****@nowhere.net> wrote in message
news:Og**************@TK2MSFTNGP14.phx.gbl...
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

Nov 19 '05 #2
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" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:u7**************@TK2MSFTNGP09.phx.gbl...
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" <no****@nowhere.net> wrote in message
news:Og**************@TK2MSFTNGP14.phx.gbl...
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


Nov 19 '05 #3
PJ6
Why don't you read my question again.

Paul

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:u7**************@TK2MSFTNGP09.phx.gbl...
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" <no****@nowhere.net> wrote in message
news:Og**************@TK2MSFTNGP14.phx.gbl...
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


Nov 19 '05 #4
PJ6
Aha! I knew there was something built in.

Thanks,
Paul

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:en**************@TK2MSFTNGP14.phx.gbl...
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" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:u7**************@TK2MSFTNGP09.phx.gbl...
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" <no****@nowhere.net> wrote in message
news:Og**************@TK2MSFTNGP14.phx.gbl...
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



Nov 19 '05 #5

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

Similar topics

1
by: Ron Vecchi | last post by:
I am using asp.net to upload an image and then perform resizing on it and saving the different sizes to file. The resized images were coming up and being displayed in the bowser fine but the image...
11
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the...
7
by: Scott Schluer | last post by:
Is there a way to use the Image class to convert a color photo (GIF or JPEG) to a B&W photo? Thanks, Scott
3
by: Hitesh | last post by:
Hi, I am getting the response from another Website by using the HttpHandler in my current site. I am getting the page but all the images on that page are not appearing only placeholder are...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
7
by: Microsoft | last post by:
I'm not sure where to physically place my subroutines in vb.net I get namespace and not declared errors... Imports System Imports System.Management Public Class Form1
3
by: Mad Scientist Jr | last post by:
Can someone post a clear example of how to change the background color of an individual datagrid cell for a Windows desktop app? (preferably in vb.net) I found some code on how to do this when...
5
by: Erol | last post by:
How do I get a type from a string? I'm retrieving a string value from my database so that I can set my property values dynamically. In the event "Form1_Load", you will see that I'm trying to set...
1
by: Ray Cassick \(Home\) | last post by:
Ok, here is apparently another odd one... I am (as I said in a previous posting here) building a user control that inherits from System.Windows.Forms.UserControl. This base class contains a...
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
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: 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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.