ItemData Property (AListBox)

Returns or sets a specific number for each item in the object.

Syntax

Object.ItemData ( IIndex ) [ = lItemData ]

The ItemData property syntax has the following parts:

 

Name

Type

Description

Object

AListBox

AListBox control

IIndex

Long

An integer specifying the position of the item in the BString text array.

lItemData

Long

The specified number for that item.

Comments

The ItemData property is an array of long integer values with the same number of current items. The numbers associated with each item can be used to identify the items. The ItemData property is often used as an index for an array of data structures associated with the control's items.

Example

The following statement changes the AListBox ItemData 8th item in the ItemData array to be 10:

lb1.ItemData(7)=10

The following shows the test results being stored in the AListBox ItemData array and retrieved :

if lb1.ListIndex<>-1

TestResult=lb1.ItemData(lb1.ListIndex)

else

TestResult=-1

endif

Applies to

AListBox

See Also

List, ListCount, ListIndex