TopIndex

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

Syntax

object.TopIndex [= value]

The parts of the TopIndex property syntax are described in the following table.

Part Description
object An object expression that evaluates to an object.
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.