AddItem Method (AListBox)

Adds an item to the object.

Syntax

[ lAddItem = ] Object.AddItem ( sItem )

The AddItem method syntax has the following parts:

 

Name

Type

Description

Object

AListBox

AListBox control

sItem

Val BString

The text string being added.

lAddItem

Long

The return value is the zero-based index of the string in the list box.

Comments

If an error occurs, the return value is -1 (for example, there was insufficient space to store the new string).

Example

The following example will add the text string "apples" by value to the AListBox and will return the index in the string of the added item:

llb1AddItem = lb1.AddItem("apples")

Applies to

AListBox

See Also

FindItem, InsertItem, RemoveItem, Sorted