473,473 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Setting Web Colors in C#

I'm having trouble figuring out which objects and what syntax to use to set Web Control Colors using RGB values from Code-Behind

Let's say I have a control WebCtl and I want to set it's BackColor to "#ffee22" dynamically in CS code. I can't find a color object that I use. Is it this COlorConverter class? I'm confused about how to use it

WebCtl.BackColor = ???

Thanks

Alex
Nov 18 '05 #1
2 2871
Make sure that you have the system.drawing namespace imported first. Then
you can use the
System.Drawing.Color.FromArgb() method to get the correct color like so:
WebCtl.BackColor = System.Drawing.Color.FromArgb(255,238,34);

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"Alex Maghen" <al**@maghen.com> wrote in message
news:9D**********************************@microsof t.com...
I'm having trouble figuring out which objects and what syntax to use to set Web Control Colors using RGB values from Code-Behind.
Let's say I have a control WebCtl and I want to set it's BackColor to "#ffee22" dynamically in CS code. I can't find a color object that I use. Is
it this COlorConverter class? I'm confused about how to use it.
WebCtl.BackColor = ????

Thanks.

Alex

Nov 18 '05 #2
That'll do it! Thanks

Ale

----- Mark Fitzpatrick wrote: ----

Make sure that you have the system.drawing namespace imported first. The
you can use th
System.Drawing.Color.FromArgb() method to get the correct color like so
WebCtl.BackColor = System.Drawing.Color.FromArgb(255,238,34)

Hope this helps
Mark Fitzpatric
Microsoft MVP - FrontPag
"Alex Maghen" <al**@maghen.com> wrote in messag
news:9D**********************************@microsof t.com..
I'm having trouble figuring out which objects and what syntax to use t

set Web Control Colors using RGB values from Code-Behind
Let's say I have a control WebCtl and I want to set it's BackColor t "#ffee22" dynamically in CS code. I can't find a color object that I use. I
it this COlorConverter class? I'm confused about how to use it WebCtl.BackColor = ???
Thanks
Ale


Nov 18 '05 #3

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

Similar topics

14
by: Jorg Matter | last post by:
Hello I should like to define the colors of the scrollbars for divs with overflows set to auto. I have a design with black background and white text. Now the scrollbars do not look very nice and...
7
by: TomHL | last post by:
hello, - I have a Bitmap Object named: bmp1 - I already have the numerical values of:red,blue and green colors + I have the X and Y cordinates. How do I set the pixel value via safe code on...
2
by: Cliff Lane | last post by:
I have an application that allows the user to select fore and back ground colors for command buttons. I use the dialog to select the colors and store the value returned in the db as a string. For...
1
by: fripper | last post by:
In VB 2005ave a I have a picture control ("pix") on which I want to set each pixel color according to a variable, X, that has been calculated (I'm drawing fractals from the Mandelbrot Set). I use...
1
by: Demi | last post by:
I want to be able to define standard colors in a base form, then have child forms use those values instead of standard colors. Ex in my base form I want to do this: Color myColor =...
6
by: vijai.kalyan | last post by:
Hello, I wrote a trivial program to set the console title in a console application. Here is the code:- namespace myns { class SetTitle { static void Main ( string args )
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
8
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to set the color of a visited HyperLinkField (the link text) in a GridView?? Here is the markup of the HyperLinkField I have problems with: <asp:HyperLinkField...
4
by: K Viltersten | last post by:
I've used the Colors class to access a bunch of colors for my applications. Now, i'd like to create a family for of each such color as follows. public Color Normal {get{return Colors.Orange;}}...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
1
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
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,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.