NewIndex, NewItemId
These properties tell you the index and itemid of the item you most recently added to a list or combo box.
Usage |
nIndexAssigned = oObject.NewIndex nItemIdAssigned = oObject.NewItemId |
Example |
* Use NewItemId to avoid counting as you add a series of items * to a multi-column list. * This is the same example as in the AddListItem entry, * except that NewItemId is used instead of an explicit counter * Fill a list box with the names and titles from Employee * This code might be in the Init method of the list box This.ColumnCount = 3 This.ColumnWidths = "75,60,150" SELECT Employee SCAN This.AddListItem(Last_Name) This.AddListItem(First_Name, This.NewItemId, 2) This.AddListItem(Title, This.NewItemId, 3) ENDSCAN * To see them in alpha order, add This.Sorted=.T. |
See Also |
AddItem, AddListItem, ComboBox, ListBox, ListCount, ListIndex, ListItemId |