This control displays a list of items from which a user can make selections. If the number of items exceeds the number that can be displayed, the toolkit automatically adds a scroll bar to the ListBox control.
ListBox
The ListBox control supports the following properties:
The ListBox control supports the following methods:
AddItem | RemoveItem |
Clear (Clipboard, ComboBox, ListBox) | SetFocus |
Move | ZOrder |
Refresh |
The ListBox control supports the following events:
Click | LostFocus |
DblClick | MouseDown |
GotFocus | MouseMove |
KeyDown | MouseUp |
KeyPress | Scroll |
KeyUp |
To add or delete items in a ListBox control, use the AddItem or RemoveItem method. Set the List, ListCount, and ListIndex properties to enable a user to access items in the ListBox.
If no item is selected, the ListIndex property value is –1. The first item in the list is ListIndex 0, and the value of the ListCount property is always one more than the largest ListIndex value.