会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Loading
joe-yang
Great works are performed, not by strength, but by perseverance.
博客园
首页
新随笔
联系
订阅
管理
winForm --listbox
Code
InfomationCollection infos
=
new
InfomationController().FetchByQuery(q);
listBox1.DisplayMember
=
Infomation.TitleColumn.ColumnName;
//
显示text值
listBox1.ValueMember
=
Infomation.AddressColumn.ColumnName;
//
value值
listBox1.DataSource
=
infos;
Code
if
(listBox1.SelectedItem
!=
null
)
{
string
value
=
listBox1.SelectedValue.ToString();
//
取得value值
string
text
=
listBox1.SelectedItem.ToString();
//
取得text值
}
posted @
2009-05-16 13:34
.net's
阅读(
448
) 评论(
0
)
收藏
举报
刷新页面
返回顶部
公告