Flex3里的ComboBox可以设置rowcount。但是spark.components.DropDownList里没有该属性。
最后仔细研究,发现奥妙全部都在skin里。
新建一个DropDownList的skin,关键属性处我已经设置成了加亮显示,自己一试便知。
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabled=".5">
<fx:Metadata>
<![CDATA[
/**
* @copy spark.skins.spark.ApplicationSkin#hostComponent
*/
[HostComponent("spark.components.DropDownList")]
]]>
</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="open" />
<s:State name="disabled" />
</s:states>
<s:PopUpAnchor id="popUp" displayPopUp.normal="false" displayPopUp.open="true" includeIn="open"
left="0" right="0" top="0" bottom="0" itemDestructionPolicy="auto"
popUpPosition="below" popUpWidthMatchesAnchorWidth="true">
<s:Group id="dropDown" maxHeight="270" minHeight="22" >
<s:RectangularDropShadow id="dropShadow" blurX="20" blurY="20" alpha="0.45" distance="7"
angle="90" color="#000000" left="0" top="0" right="0" bottom="0"/>
<s:Rect id="border" left="0" right="0" top="0" bottom="0">
<s:stroke>
<s:SolidColorStroke id="borderStroke" weight="1"/>
</s:stroke>
</s:Rect>
<s:Rect id="background" left="1" right="1" top="1" bottom="1" >
<s:fill>
<s:SolidColor id="bgFill" color="0xFFFFFF" />
</s:fill>
</s:Rect>
<s:Scroller id="scroller" left="0" top="0" right="0" bottom="0" hasFocusableChildren="false" minViewportInset="1">
<s:DataGroup id="dataGroup" itemRenderer="spark.skins.spark.DefaultItemRenderer">
<s:layout>
<s:VerticalLayout gap="0" horizontalAlign="contentJustify" requestedRowCount="10"/>
</s:layout>
</s:DataGroup>
</s:Scroller>
</s:Group>
</s:PopUpAnchor>
<s:Button id="openButton" left="0" right="0" top="0" bottom="0" focusEnabled="false"
skinClass="spark.skins.spark.DropDownListButtonSkin" />
<s:Label id="labelDisplay" verticalAlign="middle" maxDisplayedLines="1"
mouseEnabled="false" mouseChildren="false"
left="7" right="30" top="2" bottom="2" width="75" verticalCenter="1" />
</s:SparkSkin>
分享到:
相关推荐
这个是ajax 实现DropDownList无刷新联动。里面有数据库结构和内容,表结构的是sql2000的, 关键代码: <SCRIPT language="javascript"> //城市------------------------------ function cityResult() ...
ASP .NET MVC4 @Html.DropDownList后台绑定数据展示到页面下拉框中
C#下实现主从DropDownList互动的方法
DataList中如何响应DropDownList的SelectedIndexChanged事件
dropdownlist三级联动效果,function drop1() { while(document.all["DropDownList2"].options.length>1) document.all["DropDownList2"].options.remove(1);
AjaxPro.2实现DropDownList联动 sql server 2000
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (this.DropDownList1.SelectedIndex == 0) { this.DropDownList2.Items.Clear(); this.DropDownList2.Items.Add("南阳...
调用方法:DropDownList.bind(selectId).例如: --------------------------------- DropDownList2: <option selected="selected" value="35">gdfgfdgjjjjjjjjjjjj └All Categories ...
<TD><asp:dropdownlist id="DropDownList3" runat="server"></asp:dropdownlist> ; LEFT: 416px; POSITION: absolute; TOP: 48px" runat="server" Width="424px"></asp:TextBox><INPUT style="Z-INDEX: 103; ...
相关JS: 代码如下:[removed] function SearchChange() { var ddl = document.getElementById(“DropDownList1”) var index = ddl.selectedIndex; var Value = ddl.options[index].value; var Text = ddl....
该示例演示了再asp.net环境下dropdownList控件数据绑定的使用方法。
textbox与dropdownlist的结合
本系列教程的课程安排参考了多本.net 1.1以及在目前的2.0新书的基础上认真编订。不敢夸口本系列多了不起,但至少敢保证你看完本系列,再做完每个小结的测试,你入门是绝对没有问题的!做一个简单的网站是绝对可以的!...
使用方法: 引入: add silvergreen-2.1.swc to libs 使用(SWC方案): 在IDE(如:Flash Builder)里面,增加一个编译参数: ... <fx:Style source="com\ksria\flex\silvergreen\spark\style.css" />
dropdiwnlist的方法重写,实现listbox下拉框制定的值实现只读、不可选择的技巧(重写DROPDOWNLIST)
asp.net Dropdownlist结合CheckBoxList多选下拉框
DropDownList
Aspnet-DropDownList.zip,只是使用dropdownlist.dropdownlist的简单方法,asp.net是一个开源的web框架,用于使用.net构建现代web应用和服务。asp.net创建基于html5、css和javascript的网站,这些网站简单、快速,可以...
在ASP.NET 2.0 网站页面的开发过程中,经常需要把DropDownList等列表类控件的SelectedValue值设置为一个从数据库或其他地方读取出来的值。 最简单的办法就是直接进行指定: DropDownList1.SelectedValue = "中国"; ...
1.有些特殊的情况:DropDownList 想加载图片。 2.下拉菜单直接加载图片,比较明显。 3.主要是自定义一个控件当成DropDownList使用。 4.另外的操作都一样。 5.提供直接可以运行的代码。