using System.Drawing.COlor for hex color values
Posted: Mon Dec 14, 2015 3:05 pm
Im tring to set the Fill color of a button in a script, and in the page script I added:
I get errors about the type of namespace name 'ColorTranslator' does not exist in the namespce 'System.Drawing'. What is the issue here? Is there an easier way to chnage the background color of a button when pressed, or at least set some latching state?
Code: Select all
System.Drawing.Color projectBlue = System.Drawing.ColorTranslator.FromHtml("#2D6BB7");
void myButton_Click(System.Object sender, System.EventArgs e)
{
myButton.Fill = Color.projectBlue;
}