Flex中通过iconColor和borderColor样式改变CheckBox控件图标和边框颜色的例子

By Minidxer | August 3, 2008

接下来的例子演示了Flex中如何通过iconColor和borderColor样式,改变CheckBox控件图标和边框颜色。

让我们先来看一下Demo可以右键View Source或点击这里察看源代码):


下面是完整实现代码(或点击这里察看):

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  3.         layout="vertical"
  4.         verticalAlign="middle"
  5.         backgroundColor="white">
  6.  
  7.     <mx:ApplicationControlBar dock="true">
  8.         <mx:Label text="iconColor:" />
  9.         <mx:ColorPicker id="iconCol" />
  10.  
  11.         <mx:Spacer width="100" />
  12.  
  13.         <mx:Label text="borderColor:" />
  14.         <mx:ColorPicker id="borderCol" />
  15.     </mx:ApplicationControlBar>
  16.  
  17.     <mx:CheckBox selected="true"
  18.             iconColor="{iconCol.selectedColor}"
  19.             borderColor="{borderCol.selectedColor}"
  20.             label="The quick brown fox jumped over the lazy dog."
  21.             width="200"
  22.             height="120" />
  23.  
  24. </mx:Application>
代码:Peter deHaan 翻译/整理/编译:minidxer

Topics: Flex | Tags: , , , ,

Related Post

Leave a Comment

Name(*):

E-Mail(*) :

Website :

Comments :

Search Posts

Archives

Sponsored Ads