C#中的comobox [英] comobox in c#
本文介绍了C#中的comobox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的窗口应用程序中使用组合.我用areaid和areaname绑定了组合框.
Displaymember是areaname
Valuemember是areaid
现在我想要selectedItem的areaid
我怎样才能做到?
请帮帮我.
谢谢
Hi,
I use combo in my window application. I bound combobox with areaid and areaname.
Displaymember is areaname
Valuemember is areaid
Now I want areaid of selectedItem
HOW CAN I GET AREAID??
Please help me.
Thank you
推荐答案
尝试组合框控件的以下属性:
SelectedValue :它获取或设置 ValueMember 属性指定的成员属性的值.
如果需要,有关更多详细信息,请参阅:组合框属性 [ ^ ]
Try this property of the combobox control:
SelectedValue: It gets or sets the value of the member property specified by the ValueMember property.
If needed, for more details refer: Combobox properties[^]
combo.SelectedValue
阅读文档
combo.SelectedValue
It helps when you read the documentation
这篇关于C#中的comobox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文