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

How to set control color property to hexidecimal values?

P: n/a
Can some pls provide an example as to how to use the TypeConverter and/or
WebColorConverter class to set a control color property to a hexidecimal
value?

Thanks in advance.
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
hi
if i am not wrong you are looking for this

this.dataGridGroup.SelectionBackColor =ColorTranslator.FromHtml("#666666" );

regards
ansil

"charliewest" wrote:
Can some pls provide an example as to how to use the TypeConverter and/or
WebColorConverter class to set a control color property to a hexidecimal
value?

Thanks in advance.

Nov 16 '05 #2

P: n/a
When i try to use "ColorTranslator" i get an error msg that the type or
namespace cannot be found.

I am using the System.Drawing namespace and the assembly reference is
referenced in my project. I am working w/ .NET CF - does this pose a problem?

my code is: this.lblName.BackColor = ColorTranslator.FromHtml("#66666");

Thanks,

"Ansil MCAD" wrote:
hi
if i am not wrong you are looking for this

this.dataGridGroup.SelectionBackColor =ColorTranslator.FromHtml("#666666" );

regards
ansil

"charliewest" wrote:
Can some pls provide an example as to how to use the TypeConverter and/or
WebColorConverter class to set a control color property to a hexidecimal
value?

Thanks in advance.

Nov 16 '05 #3

P: n/a
Ansil,

Getting back to this issue, your example using the dataGrid control isn't
exactly what i am try to do. I am simply trying to set the background
property of a label control to a specific color in hexidecimal format.

Excuse my ignorance, but i am simply lost w/ your solution. Could you pls
provide more information? My environment is Windows Mobile 2003 developing
using the .NET CF. Thanks!

"Ansil MCAD" wrote:
hi
if i am not wrong you are looking for this

this.dataGridGroup.SelectionBackColor =ColorTranslator.FromHtml("#666666" );

regards
ansil

"charliewest" wrote:
Can some pls provide an example as to how to use the TypeConverter and/or
WebColorConverter class to set a control color property to a hexidecimal
value?

Thanks in advance.

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.