Solved

ASP.NET - Like to assign a hex color to BackColor property

Posted on 2011-03-10
3
662 Views
Last Modified: 2013-12-17
Take a look at Image 1.  The BackColor property gives me a bunch of choices, but I'd prefer to simply assign a hexadecimal value to the property.  

Image 2 shows my attempts at assigning a hex value to BackColor.  Clearly I haven't determined the right syntax yet.
BackColorValues.png
Attempts-At-Hex-Values.png
0
Comment
Question by:jdana
3 Comments
 
LVL 13

Accepted Solution

by:
gamarrojgq earned 250 total points
ID: 35095194
Hi,

Try this

ddlLaborID.BackColor = System.Drawing.Color.FromName("#C7C1C2")
0
 

Author Closing Comment

by:jdana
ID: 35095283
gamarrojgq,

You are the man.  

Thanks.

J
0
 
LVL 23

Expert Comment

by:wdosanjos
ID: 35095289
Alternatively:

ddlLaborID.BackColor = System.Drawing.Color.FromArgb(&HFFC7C1C2)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to read text with RegEx... 2 25
Using data from certificate to re-create certificate programmatically 3 26
Access/Visual Basic Question 3 25
asp.net mvc 2 25
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question