110,570
社区成员
发帖
与我相关
我的任务
分享
public TextBoxCom()
{
InitializeComponent();
defaultColor = this.BackColor;
}
protected override void OnEnabledChanged(EventArgs e)
{
if (this.Enabled)
{
this.BackColor = defaultColor;
this.SetStyle(ControlStyles.UserPaint, false);
this.Font = new System.Drawing.Font(Font.FontFamily, Font.Size, Font.Style, Font.Unit);
}
else
{
this.BackColor = SystemColors.Control;
this.SetStyle(ControlStyles.UserPaint, true);
}
base.OnEnabledChanged(e);
}
Color c = this.textBox1.BackColor;
MessageBox.Show("(" + c.R.ToString() + "," + c.G.ToString() + "," + c.B.ToString() + ")");