AddItem Method

Adds a new item to the list array (list box or combo box control).

object.AddItem(Item, Index)

Client support

   Newlook Smartclient

   Newlook Server

Parameters

Item - (String, Required)

String value specifying the text component of the item.

Index - (Integer, Optional)

The position within the collection to create the new item. If this value is zero the item will be added to the start of the list.

Use

If the control's Sorted property is set to True then each item will be given an index that corresponds to its sort order in the list and any index specified in the Index argument will be ignored. The NewIndex property can then be used to determine the index of a newly inserted item.

The ListCount property can be used to determine the number of items in the list array.

NOTE!

Adding an item using this method causes the index of every subsequent item in the list and the count property of the list items collection to increment by 1.

See Also

List property (ComboBox) | List property (ListBox) | RemoveItem method | Clear method - ComboBox | Clear method - ListBox

Applies To

Combo box control

List box control


© 2004-2021 looksoftware. All rights reserved.