using System.Drawing.Imaging;
方法1
string a = "#555555";
this.button1.BackColor = System.Drawing.Color.FromArgb(0,0,0);
方法2
this.button1.BackColor =System.Drawing.Color.FromArgb(
System.Int16.Parse(a.Substring(1,2),System.Globalization.NumberStyles.AllowHexSpecifier),
System.Int16.Parse(a.Substring(3,2),System.Globalization.NumberStyles.AllowHexSpecifier),
System.Int16.Parse(a.Substring(5,2),System.Globalization.NumberStyles.AllowHexSpecifier)
);
方法3
Color color = System.Drawing.Color.FromArgb(0xf0,0xf1,0xf2);
this.button1.BackColor = color;
System.Drawing.ColorConverter cc = new System.Drawing.ColorConverter();
方法4
string lbtncolor = "#8E8E8E";
System.Drawing.ColorConverter cc = new System.Drawing.ColorConverter();
lbtn.BackColor = (System.Drawing.Color)cc.ConvertFromString(lbtncolor);