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.
Unfortunately, activation email could not send to your email. Please try again.

change background color of textbox on focus

Thread ID:

Created:

Updated:

Platform:

Replies:

17279 Aug 4,2004 09:07 PM Aug 5,2004 06:27 AM Windows Forms 1
loading
Tags: Tools
red27man
Asked On August 4, 2004 09:07 PM

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

Administrator [Syncfusion]
Replied On August 5, 2004 06:27 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;