Solved

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

Posted on 2011-03-10
3
664 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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