(Formerly known as ListBoxGetItemText, which is now obsolete)
(Formerly known as ListBox.GetItemText, which is now obsolete)
(Formerly known as ListBox.SetItemText, which is now obsolete)
String ListBox.Items[index]
Gets/sets the text of the list box item at INDEX.
List box items are numbered starting from 0, so the first item is 0, the
second is 1, and so on. The highest allowable index is ItemCount minus 1.
If you want to add a new item to the listbox, use the ListBox.AddItem method.
Example:
String selectedItemText = lstOptions.Items[lstOptions.SelectedIndex];
will get the text of the selected item in the list box.
See Also: ListBox.SelectedIndex,
ListBox.ItemCount,
ListBox.AddItem
|