点击提交按钮后,想让文本框的背景变成浅灰色。搜索的结果:
this.txtUserName.BackColor = System.Drawing.Color.LightGray;
this.txtUserName.BackColor = System.Drawing.Color.FromArgb(0x336699);
this.txtUserName.BackColor =
System.Drawing.
Color.FromArgb(((System.Byte)(255)), ((System.Byte)(0)), ((System.Byte)(0)));
很简单,只要知道System.Drawing命名空间就可以了。
还有论坛上用这些方法,等有机会试一试:
bodytag.Attributes.Add("bgcolor", "#ff0099");
form1.Attributes.Add("style", "background-color:#FF5050;");
form1.Attributes.CssStyle.Add("BACKGROUND-COLOR", "#FF5050");
这幅图能看清颜色名称