Flex中如何通过backgroundDisabledColor样式设置无效状态下TextArea控件背景颜色的例子
By Minidxer | August 18, 2008
接下来的例子演示了Flex中如何通过backgroundDisabledColor样式,设置无效状态下TextArea控件背景颜色。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码):
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <!-- http://blog.flexexamples.com/2008/08/17/changing-the-background-color-of-a-disabled-textarea-control-in-flex/ -->
- <mx:Application name="TextArea_backgroundDisabledColor_test"
- xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <mx:String id="lorem" source="lorem.txt" />
- <mx:ApplicationControlBar dock="true">
- <mx:Form styleName="plain">
- <mx:FormItem label="backgroundDisabledColor:">
- <mx:ColorPicker id="colorPicker"
- selectedColor="#CCCCCC" />
- </mx:FormItem>
- <mx:FormItem label="enabled:">
- <mx:CheckBox id="checkBox"
- selected="true" />
- </mx:FormItem>
- </mx:Form>
- </mx:ApplicationControlBar>
- <mx:TextArea id="textArea"
- text="{lorem}"
- backgroundDisabledColor="{colorPicker.selectedColor}"
- enabled="{checkBox.selected}"
- width="100%"
- height="100%" />
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Flex |
Tags: backgroundDisabledColor, enabled, TextArea, 背景颜色