C# - Control Enabled/disabled Backcolor issue...

EFileTahi-A

Contributor
Joined
Aug 8, 2004
Messages
623
Location
Portugal / Barreiro
Ok, we all know that when a textbox is disabled its backcolor will also change. The problem is when you change the textbox backcolor during runtime. If you disable the a textbox after its backcolor was changed, it will no longer change to its disabled color but keep the one you assign.

What I need to know is how can I tell the textbox to keep changing to its disabled color even after I forced it to go yellow?

If this was not explicit enough let me know about it...
 
Last edited:
Never faced that problem, but seems to me like a feature of the control.

Try to handle that yourself, using the EnabledChanged Event of the textbox.
This way you'll be shure that you'll get the correct colors.

Just a short note.
When desabling, you'll need to have a background variable to hold the backcolor you want to appear when enabled...
Set this variable before setting the desable color.

Alex :p
 
Back
Top