RNJ
RNJ

Reputation: 15552

Flex: setting disabled color of dropdownlist

I would like to disable a spark drop down list but do not want to have the alpha color over it. I want the color to stay exactly the same. (by user requirements)

I have this code but the disabled color is still the standard disabled color.

mydropdown.enabled = false; mydropdown.setStyle("disabledColor", 0xFFFFFF);

Am I missing something?

Thanks Richard

Upvotes: 0

Views: 1229

Answers (1)

Jacob Eggers
Jacob Eggers

Reputation: 9322

DropDownList is different from DateField as it is spark vs mx. So you will want to set a custom skinClass for the DropDownList.

Create a copy of DropDownListSkin, Then remove the alpha.disabled=".5" from the top tag.

mydropdown.setStyle("skinClass", MyDropDownSkin);

Edit Adding an alternative You can also wrap the dropdown in a group with the style disabledAlpha set to 1

<s:Group disabledAlpha="1" enabled="false">
    <s:DropDownList />      
</s:Group>

Upvotes: 2

Related Questions