小小菜鸟的web菜园子

web开发学习。好记性不如烂笔头。每天进步一点点!

导航

定义ComboBox(下拉列表)组件垂直滚动条的样式。

dropdownStyleName样式和 verticalScrollBarStyleName 样式.的学习
示例:

代码:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/12/29/styling-a-flex-3-combobox-controls-vertical-scroll-bars/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="top"
        backgroundColor
="white">

    
<mx:Style>
        .myCustomComboBox {
            dropdownStyleName: myCustomDropdown;
        }

        .myCustomDropdown {
            fontWeight: normal;
            verticalScrollBarStyleName: myCustomVertScroll;
        }

        .myCustomVertScroll {
            trackColors: white, white;
            upArrowSkin: Embed("bullet_delete.png");
            downArrowSkin: Embed("bullet_add.png");
        }
    
</mx:Style>

    
<mx:Array id="arr">
        
<mx:Object label="One" />
        
<mx:Object label="Two" />
        
<mx:Object label="Three" />
        
<mx:Object label="Four" />
        
<mx:Object label="Five" />
        
<mx:Object label="Six" />
        
<mx:Object label="Seven" />
    
</mx:Array>

    
<mx:Form>
        
<mx:FormItem label="default:">
            
<mx:ComboBox id="comboBox1"
                    dataProvider
="{arr}" />
        
</mx:FormItem>
        
<mx:FormItem label="skinned:">
            
<mx:ComboBox id="comboBox2"
                    dataProvider
="{arr}"
                    styleName
="myCustomComboBox" />
        
</mx:FormItem>
    
</mx:Form>

</mx:Application>

posted on 2008-04-25 19:56  『小小菜鸟』  阅读(3442)  评论(2编辑  收藏  举报