ListBox Control

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.

Syntax

ListBox

The ListBox control supports the following properties:

Appearance ForeColor SelCount
BackColor Height Selected
Columns HWnd Sorted
Container ItemData Style
Enabled Left TabIndex
Font List TabStop
FontBold ListCount Tag
FontItalic ListIndex Text
FontStrikethru MultiSelect Top
FontUnderline Name TopIndex
FontName NewIndex Visible
FontSize Parent Width

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  

Remarks

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.