Wiki Home

Top Index


Namespace: WIN_COM_API

Culled from VFP Help: Top Index applies to the Combo Box and List Box base classes, and Specifies the item that appears in the top-most position in a list. Not available at design time; read-only at run time.

Syntax: control.topindex[ = nIndex], where nIndex specifies the index of the item that appears in the top-most position in a list. The index of an item reflects its position in the list, which is relative to other items in the list and can change.
According to Hack Fox: docs through VFP 5.0a say you can change this property for both combos and list boxes. 'Tain't so. The docs for VFP 6 say that Top Index is read-only at runtime, while TopItemId is read-write. That's wrong, too.

For combos, these properties are read-only. Our take is that this is a bug in the docs, not in the product. The nature of combo boxes is that they always open with the current value displayed in the visible portion of the scrollable part, so the ability to change the top item doesn't make sense.
Category VFP Control Properties
( Topic last updated: 1999.07.24 11:21:40 PM )