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

Getting BackColor

I'm displaying radio buttons with specific backcolors to allow the user to
select one of the colors. I want to get this color and somehow put it into
a style sheet from code so that I can produce custom appearance.

However, if I say...

dim myColor as system.drawing.color
myColor = RadioButton1.backcolor

I just get the color object in myColor where I can retrieve the R,G, & B
values but I can't see how I can get something like "Red" or #F003830 that I
could put into a style sheet. How can this be done?
Thanks,
T
Mar 10 '06 #1
1 927
Hi,

System.Drawing.ColorTranslator class should help you.
http://msdn.microsoft.com/library/de...ClassTopic.asp

It has methods to convert between color object and it's HTML representation.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
I'm displaying radio buttons with specific backcolors to allow the user to
select one of the colors. I want to get this color and somehow put it
into a style sheet from code so that I can produce custom appearance.

However, if I say...

dim myColor as system.drawing.color
myColor = RadioButton1.backcolor

I just get the color object in myColor where I can retrieve the R,G, & B
values but I can't see how I can get something like "Red" or #F003830 that
I could put into a style sheet. How can this be done?
Thanks,
T

Mar 10 '06 #2

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

Similar topics

1
by: SeanT | last post by:
I can't seem to get the value associated with an attribute I created on a table row called "BackColor". I can get the length without issue, but whenever I try the value I get nothing. Thanks in...
2
by: Alex | last post by:
Hi all, I'm writing a small web application which searches a database based on a date field, and populates a datagrid control with the results. The datagrid control has selection buttons added...
0
by: Tim::.. | last post by:
Why doesn't my onEditCommand work??? I don't get an error it just doesn't do the page redirect as requested... Thanks ...CODE.. Sub LinkButton_OnClick(ByVal sender As Object, ByVal e As...
2
by: Mike P | last post by:
I know how to get at different controls in a gridview using FindControl, and I can change the forecolor or backcolor of the control in the RowDataBound event (see below). But what I want to do is...
0
by: rajesh0303 | last post by:
Iam get null values in the datakeynames AlertID,ItemID while executing the Insert Command....I am Inserting using Externel button Event.Here is the code of Gridiew ,Its datasource and the button...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.