positionCollection(obj: Object; row: Integer);
The positionCollection method of the ListBox class positions the collection attached to the list box control to an object in that collection and to a position within the list box.
Use the obj parameter to specify the object to be positioned and the row parameter to specify the visible row in which to position that object.
You can use this method to scroll through an existing collection display by specifying the new position of an object within the current display. For example, the following code fragment scrolls the collection view so that the second item is positioned in the top row.
listBox1.positionCollection(listBox1.itemObject[2], 1);
When using the positionCollection method:
The specified row may not be the resulting displayed row if the required control cannot display sufficient entries to fill the list box.
The listIndex property is set to the row of the object.
If the specified object is not a visible member of the collection in the list box, the display starts from the first visible collection entry.
If the specified row is:
Less than 1, 1 is assumed.
Greater than the number of rows in the list box, the number of visible rows is assumed.