By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,417 Members | 1,856 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,417 IT Pros & Developers. It's quick & easy.

Setting Web Colors in C#

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.