Tuesday, June 10, 2008

Convert Hex Value of color and apply to a control

A simple thing...To convert any hex value and apply to a control using code behind, use the below

System.Drawing.ColorConverter ccColorConverter = new System.Drawing.ColorConverter();

txtAAgency.ControlStyle.BackColor = (System.Drawing.Color)ccColorConverter.ConvertFrom("#EEEEEE");

No comments: