hi,
Can someone tell me how to know which listboxitem from a listbox was selected by the user?
This is the listboxitem.
<ListBoxItem HorizontalAlignment="Left" Name="Canvas" Foreground="White" FontSize="60" Background="White" BorderBrush="White" Width="763" Height="72" >
The following are not working
if (MyList.SelectedItem.ToString() == "Canvas") { canvaswindow cw = new canvaswindow(); cw.Show(); this.Close(); } private void ListBoxItem_Selected_1(object sender, RoutedEventArgs e) { if (MyList.SelectedItem.ToString() == "Canvas") { canvaswindow cw = new canvaswindow(); cw.Show(); this.Close(); } }
Thanks,
Shaleen
TheHexLord