How to set control color property to hexidecimal values?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
hi
if i am not wrong you are looking for this

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

regards
ansil
 
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,

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!
 
Back
Top