ASP.NET改变控件背景色的代码如下:
Label1.BackColor = System.Drawing.Color.FromArgb(23, 189, 32); //RGB颜色值
Label1.BackColor = System.Drawing.Color.Red; //某一种纯色
Label1.BackColor = System.Drawing.ColorTranslator.FromHtml("#ffff44"); //丰富的网页颜色,可以自定义颜色值
Winform改变控件背景色的代码如下:
label1.BackColor = Color.Red;
label1.BackColor = Color.FromArgb(12, 34, 123);