NewIndex

Returns the index of the item most recently added to a ComboBox or ListBox control. Read-only at run time.

Syntax

object.NewIndex

The object placeholder represents an object expression that evaluates to an object.

Remarks

You can use this property with sorted lists when you need a list of values that correspond to each item in the ItemData property array. As you add an item in a sorted list, Visual Basic inserts the item in the list in alphabetic order. This property tells you where the item was inserted so that you can insert a corresponding value in the ItemData property at the same index.

The NewIndex property returns -1 if there are no items in the list or if an item has been deleted since the last item was added.