NewIndex

This property returns the index of the item most recently added to a ComboBox control, ListBox control, or CommandBarComboBox object.

Syntax

object.NewIndex

Parameters

object
Object expression that evaluates to a ComboBox or ListBox control as well as a CommandBarComboBox object.

Remarks

The NewIndex property is read-only at run time.

Use this property with sorted lists when you need a list of values that corresponds to items in the ItemData property array. As you add an item in a sorted list, Visual Basic for Windows CE 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.