List Property

Example   Applies To   See Also

A character string array used to access the items in a ComboBox or ListBox control. Not available at design time; read-write at run time.

Syntax

Control.List(nRow [, nCol])[ = cChar]

Settings

nRow

Specifies the row of the item to be retrieved using the display order. For example, nRow = 3 specifies the third row shown in the list.

nCol

Specifies the column of the item to be retrieved using the display order. For example, nCol = 2 specifies the second column shown in the list. If nCol is not specified, the List property retrieves the first column by default. Only specify nCol for ComboBox and ListBox controls that have more than one column.

Remarks

The List property works in conjunction with the ListCount property; enumerating a list from 1 to ListCount returns all items in the list.

You cannot use array functions with the List property. However, if you set the RowSourceType property to 5 (Array) and set the RowSource property to the array of values to be contained in the list, you can use array functions on the array specified in the RowSource property.

Note   When RowSourceType is set to 0 or 1, add items to a combo box or list box using the AddItem method. To remove items, use the RemoveItem method. To keep items in alphabetic order, set the control's Sorted property to true (.T.) before adding items to the list.