Flex中如何利用textFieldStyleName样式自定义ColorPicker控件内文本风格的例子
2009-01-22 11:54:59 来源:WEB开发网接下来的例子演示了Flex中如何利用textFieldStyleName样式,自定义ColorPicker控件内文本风格。
下面是完整代码
<?xml version="1.0" encoding="utf-8"?>
<mx:Applicationxmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white"
creationComplete="init();">
<mx:Style>
.myCustomSwatchPanelStyleName {
textFieldStyleName: redBold;
}
.redBold {
color: red;
fontFamily: Courier;
fontWeight: bold;
letterSpacing: 1;
}
</mx:Style>
<mx:ApplicationControlBardock="true">
<mx:FormstyleName="plain">
<mx:FormItemlabel="editable:">
<mx:CheckBoxid="checkBox"
selected="false"/>
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>
<mx:Form>
<mx:FormItemlabel="default:">
<mx:ColorPickereditable="{checkBox.selected}" />
</mx:FormItem>
<mx:FormItemlabel="textFieldStyleName:">
<mx:ColorPickerid="colorPicker"
editable="{checkBox.selected}"
swatchPanelStyleName="myCustomSwatchPanelStyleName"/>
</mx:FormItem>
</mx:Form>
</mx:Application>
更多精彩
赞助商链接