LBGUC04
asked on
c# Net Set Label Colour
I have the below i can use to set the fore/back colour of a label but i want to be able to set it to a hex value, how can i do this ?
(e.Row.FindControl("lblGro upName") as Label).BackColor = System.Drawing.Color.Red;
(e.Row.FindControl("lblGro
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can also use:
Color.FromArgb(Int32.Parse(child.InnerText.Replace("#",""),System.Globalization.NumberStyles.HexNumber));
(e.Row.FindControl("lblGro
OR
string hex = "0xFF0000";
int red = HexToInt(hex.SubString(2, 2));
int green = HexToInt(hex.SubString(4, 2));
int blue = HexToInt(hex.SubString(6, 2));
(e.Row.FindControl("lblGro