ListItem Property

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

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

Property Values

  • nRow
    Specifies the row from which to retrieve the item. You can use the control.listitemID property.
  • nCol
    Specifies, optionally, the column from which to derive the value. If you specify only listitemID column one provides the value.
  • nChar
    Represents a value, optionally, to be assigned to the specified Control.listitem.

Remarks

Use the List property to retrieve items in the order they are displayed; use the ListItem property to retrieve items according to their item ID.

Note   To add items to a combo box or list box, use the AddItem or AddListItem method. To remove items, use the RemovetItem method or the RemoveListItem method. To keep items in alphabetic order, set the control's Sorted property to True (.T.) before adding items to the list.

The ListItem property is also set when the Selected property on a Listbox control is set.

See Also

AddItem Method | AddListItem Method | IndexToItemID Method | ItemIDToIndex Method | ListCount Property | List Property | ListItemID Property | Selected Property

Applies To: ComboBox | ListBox