Solved

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

Posted on 2011-03-10
3
661 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

785 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