Hi everyone I'm new at wpf and I got some easy question:How can I get select item value from listbox? I wrote this code:
label1.Content = listBox1.SelectedItem.ToString();
and I get:System.Cindows.Control.ListBoxItem:Test1;
how can I get just Test1.
Thanks in advance!!
Loading
Martin CookPosted Feb 10, 2010, 6:14 AM
You might want to look up Element Binding which allows you to achieve this with no code behind, something along these lines: -
Cheers
annaPosted Feb 9, 2010, 5:38 AM
Label x = listBox.SelectedItem as Label;
String y= sourcelbi.Content.ToString();
mark draganPosted Sep 9, 2009, 4:58 PM
label1.Content=item.ToString();
Hope this helps
vkyadlapalliPosted Sep 9, 2009, 3:29 AM
mark draganPosted Aug 22, 2009, 12:34 PM