Chapter 21. ListBox Class

Table of Contents
Add
Insert
Delete
DeleteAll
Find
SelectedIndex
Selected
SelectIndex
DeSelectIndex
Select
SelectRange
DeselectRange
Items
SelectedItems
SelectedIndexes
MakeFirstVisible
GetFirstVisible
GetText
Modify
SetTabulators
AddDirectory
SetWidth
Width
ItemHeight
ItemHeight=
ColumnWidth=

The ListBox class provides methods to query and modify list box controls. It inherits all methods of the DialogControl class (see page DialogControl Class).

Use the GetListBox method (see page GetListBox) to retrieve an object of the ListBox class.

Requires:

The ListBox class requires the class definition file oodwin32.cls:

::requires "oodwin32.cls"

Methods:

Instances of the ListBox class implement the methods listed in the ListBox Instance Methods table.

Table 21-1. ListBox Instance Methods

Method......on page
AddAdd
AddDirectoryAddDirectory
ColumnWidthColumnWidth
DeleteDelete
DeleteAllDeleteAll
DeSelectIndexDeSelectIndex
DeselectRangeDeselectRange
FindFind
GetFirstVisibleGetFirstVisible
GetTextGetText
InsertInsert
ItemHeightItemHeight
ItemHeight=ItemHeight=
ItemsItems
MakeFirstVisibleMakeFirstVisible
ModifyModify
SelectSelect
SelectedSelected
SelectedIndexSelectedIndex
SelectedIndexesSelectedIndexes
SelectedItemsSelectedItems
SelectIndexSelectIndex
SelectRangeSelectRange
SetTabulatorsSetTabulators
SetWidthSetWidth
WidthWidth

Add

>>-aListBox~Add(--listEntry--)---------------------------------><


The Add method adds a new item to the list. If the list is not sorted, the new item is added to the end of the list.

Arguments:

The only argument is:

listEntry

A text string added to the list.

Return value:

A one-based index that specifies the position at which the entry has been added, or 0 or a value less than 0 to indicate an error.