请帮助用户单击列表框中的项目,并且我希望标签文本中的选定项目文本 [英] please help the user is clicking an item in the ListBox and I want selected items text in a Label's text
本文介绍了请帮助用户单击列表框中的项目,并且我希望标签文本中的选定项目文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助用户单击列表框中的一个项目,我希望标签中的文本成为所选项目的文本
please help the user is clicking an item in the ListBox and I want selected items text in a Label''s text
推荐答案
好吧,那是什么错误你知道吗?
您正在尝试的工作...我只是在表格上完成的.
[修改] 1票代表什么?您错过了其他信息.他已将问题更改了三遍,之前的问题是他正在做的事情:
Ok, well, what error are you getting then?
What you are trying works...I just did it on a form.
[Modified] What''s the 1 vote for? You missed the other info. He has changed his question three times and his previous question said he was doing:
label.text= listbox1.selecteditem.tostring();
但这给了他一个错误.
因此,我的回应.
but that it was giving him an error.
Therefore, my response.
尝试,
Label1.Text=ListBox1.Text;
或
Label1.tex=ListBox1.SelectedItem.ToString();
这篇关于请帮助用户单击列表框中的项目,并且我希望标签文本中的选定项目文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文