从列表框中获取所选值 [英] Get the selected value from a listbox
本文介绍了从列表框中获取所选值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我试图从列表框中获取值,我有以下代码来获取
文本:
txtEntity.Text = ListBox1.Text
但似乎无法检索我设置为值
成员的数据。 />
谢谢
B
Hi
Im trying to get the value from a listbox, i have the below code to get the
text:
txtEntity.Text = ListBox1.Text
But do not seem to be able to retrieve the data that i set as the value
member.
Thanks
B
推荐答案
使用ListBox1.SelectedValue
/ claes
" Ben" < Be*@Newsgroups.microsoft.com>在消息中写道
news:uk ************** @ tk2msftngp13.phx.gbl ...
Use ListBox1.SelectedValue
/claes
"Ben" <Be*@Newsgroups.microsoft.com> wrote in message
news:uk**************@tk2msftngp13.phx.gbl...
嗨
我试图从列表框中获取值,我有以下代码来获取
文本:
txtEntity.Text = ListBox1.Text
>但似乎无法检索我设置为值
成员的数据。
感谢
B
Hi
Im trying to get the value from a listbox, i have the below code to get
the
text:
txtEntity.Text = ListBox1.Text
But do not seem to be able to retrieve the data that i set as the value
member.
Thanks
B
嗨Claes
感谢您的帖子:当我使用它时,我得到:
txtEntity .Text = ListBox1.SelectedValue
谢谢B
" Claes Bergefall" <螺***** @ nospam.nospam>在留言中写道
新闻:O9 ************** @ TK2MSFTNGP10.phx.gbl ...
Hi Claes
Thanks for your post: when i use it i get:
txtEntity.Text = ListBox1.SelectedValue
Thanks B
"Claes Bergefall" <lo*****@nospam.nospam> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
使用ListBox1.SelectedValue
/ claes
" Ben" < Be*@Newsgroups.microsoft.com>在消息中写道
新闻:英国************** @ tk2msftngp13.phx.gbl ...
Use ListBox1.SelectedValue
/claes
"Ben" <Be*@Newsgroups.microsoft.com> wrote in message
news:uk**************@tk2msftngp13.phx.gbl...
嗨
我试图从列表框中获取值,我有以下代码来获取
文本:
txtEntity.Text = ListBox1.Text
但不要似乎能够检索我设置为值
成员的数据。
感谢
B
Hi
Im trying to get the value from a listbox, i have the below code to get
the
text:
txtEntity.Text = ListBox1.Text
But do not seem to be able to retrieve the data that i set as the value
member.
Thanks
B
对不起,我不明白。你得到了什么?
你和ListBox1.Text一样吗?
你如何填充你的列表框?
>
/ claes
" Ben" < Be*@Newsgroups.microsoft.com>写在消息
新闻:ec ************** @ TK2MSFTNGP12.phx.gbl ...
Sorry, I don''t understand. What do you get?
Do you get the same thing as ListBox1.Text?
How are you populating your listbox?
/claes
"Ben" <Be*@Newsgroups.microsoft.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...
嗨Claes
感谢您的帖子:当我使用它时,我得到:
txtEntity.Text = ListBox1.SelectedValue
感谢B
Claes Bergefall ; <螺***** @ nospam.nospam>在消息中写道
新闻:O9 ************** @ TK2MSFTNGP10.phx.gbl ...
Hi Claes
Thanks for your post: when i use it i get:
txtEntity.Text = ListBox1.SelectedValue
Thanks B
"Claes Bergefall" <lo*****@nospam.nospam> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
使用ListBox1.SelectedValue
/ claes
本 < Be*@Newsgroups.microsoft.com>在消息中写道
新闻:英国************** @ tk2msftngp13.phx.gbl ...
Use ListBox1.SelectedValue
/claes
"Ben" <Be*@Newsgroups.microsoft.com> wrote in message
news:uk**************@tk2msftngp13.phx.gbl...
>嗨
>
>我试图从列表框中获取值,我有以下代码来获取
>
>文字:
> txtEntity.Text = ListBox1.Text
>
>但似乎无法检索我设置为值的数据
>会员。
>
>谢谢
>
> B
>
>
> Hi
>
> Im trying to get the value from a listbox, i have the below code to get
> the
> text:
> txtEntity.Text = ListBox1.Text
>
> But do not seem to be able to retrieve the data that i set as the value
> member.
>
> Thanks
>
> B
>
>
这篇关于从列表框中获取所选值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文