Q:

Handle the selected items in list items

in WPF, the list items contains some of items, when an item in list items is selected, i need to handle some of event on the selected item
after create a method that get the selected item
 private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        string y = this.LBOX.SelectedItem.ToString();
        MessageBox.Show(y);
    }

this method show : System.Windows.Control.ListBoxItem.List1

A:

It looks like you are storing strings in your ListBoxItems, the SelectedItem property is actually returning an object that you need to cast to a ListBoxItem so that you can access the Content Property and then use the ToString Method on it. Something like this should work for you.
string y = ((ListBoxItem)LBOX.SelectedItem).Content.ToString();

