class TextBoxGreen : TextBox { protected override void OnGotFocus(EventArgs e) { base.OnGotFocus(e); string BckClr = this.BackColor;// capturing current back color this.BackColor = Color.Lime; } protected override void OnLostFocus(EventArgs e) { base.OnLostFocus(e); this.BackColor = BckClr; // setting original back color on lost focus } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)