I am struggling to find a way to get the selected item from a ListBox. The following gives a syntax error and using ToString() just returns the name of the damn thing. The list box was populated with strings.
string selected = myList.SelectedItem; but SelectedItem is a ListBoxItem.
It looks like my only option is to keep a separate list that matches with the listbox entries and use the SelectedIndex to point to the one I want in my separate list.
I just wanted to take a moment to thank you for your enlightening contribution to the forum. Your insights were both thought-provoking and informative. The clarity and depth with which you shared your thoughts truly made a difference, and I’m sure many, including myself, will carry your advice forward.
Looking forward to reading more of your contributions in the future!