Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
please help the user is clicking an item in the ListBox and I want selected items text in a Label's text
Posted
Updated 9-Mar-10 9:03am
v3

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:
C#
label.text= listbox1.selecteditem.tostring();

but that it was giving him an error.

Therefore, my response.
 
Share this answer
 
v3
try,
C#
Label1.Text=ListBox1.Text;
Or
C#
Label1.tex=ListBox1.SelectedItem.ToString();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900