Is there a way to specify the hexadecimal code(something like #E9E9E9) while setting the color of a datagrid instead of using the below code.
dg.BackColor = System.Drawing.Color.LightGray
Is there a way to specify the hexadecimal code(something like #E9E9E9) while setting the color of a datagrid instead of using the below code.
dg.BackColor = System.Drawing.Color.LightGray
dg.BackColor = System.Drawing.ColorTranslator.FromHtml("#E9E9E9");
Color
to html string). –
Rotatory FromHtml
with reflector. I like this special handling of LightGrey ;-) –
Rotatory try this :
dg.BackColor = Sytem.Drawing.Color.FromArgb(0, 0xE9, 0xE9, 0xE9);
or
string myColor = "#E9E9E9";
dg.BackColor = Sytem.Drawing.Color.FromArgb(int.Parse(myColor.Replace("#", "0x"));
© 2022 - 2024 — McMap. All rights reserved.