We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

change background color of textbox on focus

hi i need to change the background color of textbox on focus...can someone help me Thanks kevin

1 Reply

AD Administrator Syncfusion Team August 5, 2004 10:27 AM UTC

Hi Kevin, You could handle the TextBoxExt''s GotFocus and LostFocus events for this purpose (refer code below) : private void TextBoxExt_GotFocus (object sender, EventArgs args) { TextBoxExt textbox = sender as TextBoxExt; textbox.BackColor = Color.LightSkyBlue; textbox.Border3DStyle = Border3DStyle.Flat; textbox.BorderStyle = BorderStyle.FixedSingle; textbox.BorderColor = Color.Navy; } private void TextBoxExt_LostFocus (object sender, EventArgs args) { TextBoxExt textbox = sender as TextBoxExt; textbox.BackColor = SystemColors.Window; textbox.Border3DStyle = Border3DStyle.Flat; textbox.BorderStyle = BorderStyle.FixedSingle; textbox.BorderColor = Color.Black; } Please refer to the complete sample attached here and let me know if this meets your requirements. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Up arrow icon