AddItem Method

Adds a new item to a ComboBox or ListBox control, optionally making it possible for you to specify the item's index.

Control.AddItem(cItem [, nIndex] [, nColumn])

Parameters

cItem

Specifies the string expression to add to the control.

nIndex

Specifies the position where the item is placed in the control. If you supply a valid value for the optional nIndex, cItem is placed at that position within the control. If you specify an nIndex that already exists, the item is inserted at that position and all items below that item are moved down one position in the list portion of the ComboBox or ListBox control.

If you omit nIndex and the Sorted property is set to True (.T.), cItem is added in alphabetic sort order. If you omit nIndex and the Sorted property is set to False (.F.), cItem is added to the end of the list portion of the ComboBox or ListBox control.

nColumn

Specifies the column of the control to which the new item is added. The default is 1.

Expand imageRemarks

Expand imageExample

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic