RemoveItem Method (AListBox)

Removes an item from the object.

Syntax

[ lRemoveItem = ] Object.RemoveItem ( lIndex )

The RemoveItem method syntax has the following parts:

 

Name

Type

Description

Object

AListBox

AListBox control

lIndex

Val Long

Removes an item from the control at a zero-based position specified by lIndex.

lRemoveItem

Long

The return value is a count of the strings remaining in the list.

Comments

The return value is -1 if the lIndex parameter specifies an index greater than the number of items in the list.

Example

The following example will remove the 8th item in the AListBox:

llb1RemainingItems = lb1.RemoveItem(7)

Applies to

AListBox

See Also

AddItem, FindItem, InsertItem, Sorted