Change the Background/Text color of disabled property like text input, combo box

Hi All,

The following example shows how you can set the background or text color on a disabled Flex ComboBox,TextInput control by setting the disabledColor and backgroundDisabledColor property. It is quite very easy.

For a InputText simply add the below attributes.
<mx:TextInput id=”myId” name=”myId  disabledColor=”#000000″ backgroundDisabledColor=”#f9f9f9″ />

For Combo Box
<ComboBox id=”comboId” disabledColor=”#000000″ />

NOTE
: For combo box the backgroundDisabledColor property is not available, only disabledColor is available.

There is also a very easy quick workaround where backgroundDisabledColor could also be made possible for Combo Box. That is by using CSS style.

<mx:Style>
ComboBox {
disabledColor: red;
background-disabled-color:#f9f9f9;
}

TextInput {
disabledColor: red;
background-disabled-color:#f9f9f9;
}
</mx:Style>


Thanks,
R Vashi

4 thoughts on “Change the Background/Text color of disabled property like text input, combo box

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s