ListBox Methods

The methods defined in the ListBox class are summarized in the following table.

Method Description
addItem Adds a new item
addItemAt Adds a new item at a specified item index
clear Clears the contents
clearAllSelected Clears all selected items in the list box
displayCollection Attaches the specified collection to the list box
dragListIndex Provides the listIndex property of an entry during drag and drop actions
findObject Searches the itemObject property values of the list entries for the specified object
findString Searches the entries for an entry that matches the specified string
findStringCaseSensitive Searches the entries for an entry that matches the specified case‑sensitive string
findStringExact Searches the entries for an entry with an exact match to the specified string
findStringExactCaseSensitive Searches the entries for an entry with an exact match to the specified case‑sensitive string
getCollection Returns the collection attached to the list box by the displayCollection or listCollection method
getLineHeight Returns the height in pixels of each list box entry
getListIndex Returns the index of the displayed list entry corresponding to the position x, y
getListIndexText Returns the list index that corresponds to the specified position within the text portion of a list entry
getScrollRange Returns the scroll range information for the window
itemFullName Returns the fully qualified name of an item
itemHasSubItems Returns a Boolean value that indicates whether an item has subitems
itemVisible Returns a Boolean value that indicates whether an item is visible
lines Returns the number of lines available for display in the list box
listCollection Enables controls to have a collection attached to them
listCount Returns the number of items in the list
newIndex Returns the index of the item most recently added
positionCollection Positions the collection attached to the ListBox control to an object in that collection and to a position within the list box
positionLeft Returns the displayed left position in pixels of the start of text in the specified list entry
positionTop Returns the displayed top position in pixels of the specified list entry
refreshEntries Refreshes the displayed list of entries in the list box
removeItem Removes an item (and its subitems) from a list box
selectedCount Returns the number of entries selected in the list box

For details, see "Window, Form, and Control Methods", later in this document.