如何卸载c comboxx 如何卸载c comboxx

combox中,怎么获取选中的值 - C#当前位置:& &&&combox中,怎么获取选中的值combox中,怎么获取选中的值&&网友分享于:&&浏览:741次combox中,如何获取选中的值?combox中,如何获取选中的值?------最佳解决方案--------------------如果是绑定数据源的话。。用combobox.Selectedvalue
如果是用add&加的话。&用combobox。.SelectedItem
用combobox。text也行------其他解决方案--------------------comboBox1.SelectedItem------其他解决方案--------------------comboBox1.selectedValue------其他解决方案--------------------comboBox1.SelectedItem.ToString()------其他解决方案--------------------comboBox1.dismenberValue------其他解决方案--------------------((sender&as&ComboBox).SelectedItem&as&DtataRowView)["显示字段名"].Tostring();------其他解决方案--------------------自己找出来了,其实是combox.txt就可以了,谢谢大家
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有21:26 提问
Flex combox icon怎么居中
&?xml version="1.0" encoding="utf-8"?&
xmlns:s="library:///flex/spark"
xmlns:mx="library:///flex/mx" minWidth="955" minHeight="600"
creationComplete="aaa()"&fx:Declarations
&!-- Place non-visual elements (e.g., services, value objects) here --&
&fx:Script&
import mx.collections.ArrayC
import mx.events.DropdownE
[Bindable]
private var list:ArrayCollection = new ArrayCollection();
[Embed(source="sts_located.gif")]
private var aaaCls:C
[Embed(source="sts_partial.gif")]
private var bbbCls:C
[Embed(source="sts_unfilled.gif")]
private var cccCls:C
private function aaa():void{
list.addItem({data:"aaa",label:"aaa"});
list.addItem({data:"bbb",label:"bbb"});
list.addItem({data:"ccc",label:"ccc"});
protected function combobox1_openHandler(event:DropdownEvent):void
statusCombox.dropdown.iconFunction=getI
statusCombox.dropdown.horizontalCenter=0;
statusCombox.dropdown.verticalCenter=0;
private function getIcon(item:Object):Class{
if(item.data=="aaa"){
return aaaC
}else if(item.data=="bbb"){
return bbbC
}else if(item.data=="ccc"){
return cccC
&/fx:Script&
&mx:ComboBox id="statusCombox" x="198" y="97" dataProvider="{list}" open="combobox1_openHandler(event)"/&
如上,icon和text是不垂直对齐的,怎么才能对其
其他相似问题
相关参考资料开始时,我以为用'selected': true ,就可以了,最后给想要选中的项加上去后,发现还是只能选中第一项,最后查看官方文档
NameParameterDescription
Return the options object.
Return the loaded data.
Load the locale list data.
Request the remote list data. Pass the 'url' parameter to override the original URL value.
Code example:
$('#cc').combobox('reload');
// reload list data using old URL
$('#cc').combobox('reload','get_data.php');
// reload list data using new URL
Set the combobox value array.
Code example:
$('#cc').combobox('setValues', ['001','002']);
Set the combobox value.
Code example:
$('#cc').combobox('setValue', '001');
Clear the combobox value.
Select the specified item.
Unselect the specified item.
setValues,就可以解决这个问题。稍微注意下,这个属性要写到加载数据的后面,要不然它哪找的到啊。这个属性还有个好处,就是在添加的VALUES自由的设置前后顺序,这样,结合报表的话,id可以作为字段传过去,text作为显示,报表的列名就可以自由的控制。
Views(...) Comments()&&&&& &?xml version="1.0" encoding="utf-8"?&
&mx:Application xmlns:mx="/2006/mxml" layout="absolute" applicationComplete="init();" &
& &mx:Label id="la" text="职业" fontSize="12" x="43" y="53"/&
&mx:ComboBox id="combox" fontSize="12" editable="false" x="116" y="50" dataChange="myTestDispaly(event)"&
&mx:ArrayCollection&
&mx:Object label="工程师" data="Engineer"/&
&mx:Object label="科学家" data="Scientist"/&
&/mx:ArrayCollection&
&/mx:ComboBox&
&mx:Script&
import mx.controls.A
import flash.events.E
public function myTestDispaly(event:flash.events.Event):void{
mx.controls.Alert.show();
public function init():void{
combox.addEventListener(flash.events.Event.CHANGE,myTestDispaly);
&/mx:Script&
&/mx:Application&
怎么在这个方法中& public function myTestDispaly(event:flash.events.Event):void{
mx.controls.Alert.show();
}
得到&& combox 中的值?
各位 谢谢了
采纳的答案
看看datachange的API
dataChange
Event Object Type: mx.events.FlexEvent
property FlexEvent.type = mx.events.FlexEvent.DATA_CHANGE
Dispatched when the data property changes.
When you use a component as an item renderer, the data property contains an item from the dataProvider. You can listen for this event and update the component when the data property changes.
The FlexEvent.DATA_CHANGE constant defines the value of the type property of the event object for a dataChange event.
The properties of the event object have the following values:
Property Value
bubbles false
cancelable false
currentTarget The Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
target The Object that
it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
我觉得这样应该可以
public function myTestDispaly(event:flash.events.Event):void{
mx.controls.Alert.show();
event.currentTarget.selectedItem.label + " " +
event.currentTarget.selectedIndex;
已解决问题
未解决问题

我要回帖

更多关于 combox 的文章

 

随机推荐