List

This property returns and sets the items contained in a control's list portion. The list is a string array in which each element is a list item.

Syntax

object.List(index) [= string]

Parameters

object
Object expression that evaluates to a ComboBox, ListBox, and FileSystem controls.
index
Number of a specific item in the list.
string
String expression that specifies the list item.

Remarks

The List property works in conjunction with the ListCount and ListIndex properties.

For all controls, the index of the first item is 0 and the index of the last item is ListCount –1.

Initially, ComboBox and ListBox controls contain an empty list. To specify items you want to display in a ComboBox or ListBox control, use the AddItem method. To remove items, use the RemoveItem method. To keep items in alphabetic order, set the control's Sorted property to True before you add items to the list.

For the ListBox and ComboBox controls, the List property is available through the property browser at design time. For the ListBox and ComboBox controls, the List property is read/write at run time.