Visual Basic Reference

TopIndex Property

See Also    Example    Applies To

Returns or sets a value that specifies which item in a ComboBox, DirListBox, DriveListBox, FileListBox, or ListBox control is displayed in the topmost position. Not available at design time.

Syntax

object**.TopIndex** [**=**value]

The TopIndex property syntax has these parts:

Part Description
Object An object expression that evaluates to an object in the Applies To list.
Value The number of the list item that is displayed in the topmost position. The default is 0, or the first item in the list.

Remarks

Use this property to scroll through a control without selecting an item.

If the Columns property is set to 0 for the ListBox control, the item is displayed at the topmost position if there are enough items below it to fill the visible portion of the list.

If the Columns property setting is greater than 0 for the ListBox control, the item's column moves to the leftmost position without changing its position within the column.