ListBox: Make Single Shown Item Selected Item

Aug 5, 2009 at 3:14 PM

I have a ListBox whos datasource is an ObservableCollection of 10 integers (trying to keep example simple - will probably collections of other things later). I've tried to size the ListBox to be only one entry high. I need functionality like one of those old mechanical radios, where you move a thumbwheel to select a single value, where the value you can see is the selected value.

I start with the following to make the first item the selected item:

myListBox.SelectedItem = 0;

When the user clicks the previous or next button, I need to make the previous or next item the only visible item, and also make it the SelectedItem.

I'm also curious as to why I can't figure out what the event handler would be for the up/down (previous/next) arrows.

Any suggestions are greatly appreciated.