Using hexadecimal color code in System.Drawing.Color

Manasa picture Manasa · Feb 16, 2011 · Viewed 32.5k times · Source

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

Answer

Moo-Juice picture Moo-Juice · Feb 16, 2011
dg.BackColor =  System.Drawing.ColorTranslator.FromHtml("#E9E9E9");