I have a list box on an ASP page with a selection range from 0 - 100. I've been validating the user input like this:
if (ListBox1.SelectedIndex != 0)
SAVE THE USERS SELECTION
However, I'm finding that if the user selects (high-lights) an item (say index 1) and then scrolls down the list to item 10, but doesn't select (highlight) item 10 then item 1 ends up being the value processed.
In the picture below, the first item of the ListBox is truly selected because it is high-lighted, but it's possible to use the scroll bar/arrows to display another value and the user thinks this value is selected just because it is displayed.
Is there another property associated with ListBoxes that would enable me to test something like this:
if ((ListBox1.SelectedIndex != 0) && (ListBox1 IS CURRENTLY HIGH-LIGHTED))