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

about colors and numbers

can anybody tell me how to assign a color as a number? I couldnt find
anything for that in System.Drawing.
Example of what I need to do:
TextBox1.BackColor = "#A8D3FF";

Thanks,
Alex.
Nov 19 '05 #1
7 1131
Hi Alex,

Try System.Drawing.Color.FromArgb(168,211,255) or
System.Drawing.Color.FromArgb(CType(&HA8, Integer), CType(&HD3, Integer),
CType(&HFF, Integer))

http://msdn.microsoft.com/library/de...margbtopic.asp

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Alex D." wrote:
can anybody tell me how to assign a color as a number? I couldnt find
anything for that in System.Drawing.
Example of what I need to do:
TextBox1.BackColor = "#A8D3FF";

Thanks,
Alex.

Nov 19 '05 #2
"Alex D." <al********@hotmail.com> wrote in news:OA4msD#sFHA.3404
@TK2MSFTNGP09.phx.gbl:
can anybody tell me how to assign a color as a number? I couldnt find
anything for that in System.Drawing.
Example of what I need to do:
TextBox1.BackColor = "#A8D3FF";

I believe you'll need to convert the colour into RGB first.., and then use
System.Drawing.Color.FromArgb
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #3
"Alex D." <al********@hotmail.com> wrote in news:OA4msD#sFHA.3404
@TK2MSFTNGP09.phx.gbl:
can anybody tell me how to assign a color as a number? I couldnt find
anything for that in System.Drawing.
Example of what I need to do:
TextBox1.BackColor = "#A8D3FF";

or try System.drawing.color.fromname... that might work too
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #4
Alex,

You should use the ColorTranslator's FromHtml Method:

TextBox1.BackColor = System.Drawing.ColorTranslator.FromHtml("#00ff00") ;
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Alex D." <al********@hotmail.com> wrote in message
news:OA****************@TK2MSFTNGP09.phx.gbl...
can anybody tell me how to assign a color as a number? I couldnt find
anything for that in System.Drawing.
Example of what I need to do:
TextBox1.BackColor = "#A8D3FF";

Thanks,
Alex.

Nov 19 '05 #5
Thanks!

"Phillip Williams" <Ph**************@webswapp.com> wrote in message
news:41**********************************@microsof t.com...
Hi Alex,

Try System.Drawing.Color.FromArgb(168,211,255) or
System.Drawing.Color.FromArgb(CType(&HA8, Integer), CType(&HD3, Integer),
CType(&HFF, Integer))

http://msdn.microsoft.com/library/de...margbtopic.asp

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Alex D." wrote:
can anybody tell me how to assign a color as a number? I couldnt find
anything for that in System.Drawing.
Example of what I need to do:
TextBox1.BackColor = "#A8D3FF";

Thanks,
Alex.

Nov 19 '05 #6
Thanks Justin. That seem to be the best solution.

Alex.

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:ea****************@TK2MSFTNGP09.phx.gbl...
Alex,

You should use the ColorTranslator's FromHtml Method:

TextBox1.BackColor = System.Drawing.ColorTranslator.FromHtml("#00ff00") ;
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Alex D." <al********@hotmail.com> wrote in message
news:OA****************@TK2MSFTNGP09.phx.gbl...
can anybody tell me how to assign a color as a number? I couldnt find
anything for that in System.Drawing.
Example of what I need to do:
TextBox1.BackColor = "#A8D3FF";

Thanks,
Alex.


Nov 19 '05 #7
Thanks Lucas!

"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@127.0.0.1...
"Alex D." <al********@hotmail.com> wrote in news:OA4msD#sFHA.3404
@TK2MSFTNGP09.phx.gbl:
can anybody tell me how to assign a color as a number? I couldnt find
anything for that in System.Drawing.
Example of what I need to do:
TextBox1.BackColor = "#A8D3FF";

I believe you'll need to convert the colour into RGB first.., and then use
System.Drawing.Color.FromArgb
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com

Nov 19 '05 #8

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

Similar topics

5
by: aznFETISH | last post by:
I have a list of links that I ue on my page, I alternate background colors for these links in a table, I usually do it using a DB but this list of link is manually added into the page so my...
6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
0
by: mark | last post by:
Somebody can explain me why if I put a color with SetPixel the color showed is of another value? For example: I've to draw a grayscale image. The color RGB(90,90,90) become RGB(40,45,60). In the...
6
by: Mark | last post by:
Is there a programatic way to iterate through all the named colors? Something like: HtmlTable ht = new HtmlTable(); HtmlTableRow htr; HtmlTableCell htc; foreach (Color c in ) //I CAN'T FIND...
10
by: chanma | last post by:
code1:var x=0xf0000000; alert(x); output:4026531840 code2:var b=0xf<<28; alert(b); output:-268435456
12
by: Adam Hartshorne | last post by:
Hi All, I was wondering if somebody could post a few lines of code which would produce random colors, which will be used in defining different regions on a mesh. So in addition to having n...
4
by: Jmc | last post by:
Hi Need some advice on how to get all colors in an image. I wish to have an input file, in my case it will be a scanned piece of fabric. I would like to first of all gen an array with all the...
0
by: Sundown | last post by:
I am making a program that needs to grab a string input ie: "green * 10 + white *10 + Blue *10 + Yellow *10 + Red * 20" I am looking to parse only the numbers and colors out of the string. I...
4
by: Josetta | last post by:
Can someone point me in the right direction... We have changed our logo and colors and I am redesigning numerous reports. Does anyone know a way to add custom colors whenever I start up my...
5
by: Michael R | last post by:
Searching the net I've found a simple technique to add row numbers and alternate colors (for the even and the uneven row) to a continuous form. 1st step: Create a textbox, send it to background...
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:
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: 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: 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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.