(Formerly known as ListBoxGetSelected, which is now obsolete)
(Formerly known as ListBoxSetSelected, which is now obsolete)
int ListBox.SelectedIndex
Gets/sets the index into the list of the currently selected item. The first
item is 0, second is 1, and so on. If no item is selected, this is set to -1.
You can set this to -1 to remove the highlight (ie. un-select all items).
Example:
String selectedText = lstOptions.Items[lstOptions.SelectedIndex];
will get the text of the selected item in the listbox.
|