class ListBox
A selection list on a form, from which you can pick multiple items.
Syntax
[<oRef> =] new ListBox(<container> [,<name expC>])
<oRef>
A variable or property—typically of <container>—in which to store a reference to the newly created ListBox object.
<container>
The container—typically a Form object—to which you’re binding the ListBox object.
<name expC>
An optional name for the ListBox object. If not specified, the ListBox class will auto-generate a name for the object.
Properties
The following tables list the properties, events, and methods of interest in the ListBox class.
Property |
Default |
Description |
false |
Whether dragged objects can be dropped in the ListBox object | |
LISTBOX |
Identifies the object as an instance of the ListBox class | |
(LISTBOX) |
Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName | |
HighlightText |
The color of selected options | |
WindowText |
The color of unselected options | |
|
The number of the option that has the focus rectangle | |
|
The options strings of the ListBox object | |
false |
Whether the ListBox object allows selection of more than one option | |
false |
Whether the options are sorted | |
false |
Whether the ListBox object has the same background color or image as its container | |
|
The value of the option that currently has focus
|
Auto |
When a vertical scrollbar appears (0=Off, 1=On, 2=Auto, 3=Disabled)
|
Event |
Parameters |
Description |
<char expN>, |
When a key is pressed in the ListBox. Return value may change or cancel keystroke. |
<left expN> |
When the mouse enters the ListBox display area during a Drag&Drop operation | |
|
When the mouse leaves the ListBox display area without having dropped an object | |
<left expN> |
While the mouse drags an object over the ListBox display area during a Drag&Drop operation | |
<left expN> |
When the mouse button is released over the ListBox display area during a Drag&Drop operation |
<char expN>, |
After a key has been pressed (and the key event has fired), but before the next keypress. | |
|
After the focus moves to another option in the list
| |
Method |
Parameters |
Description |
|
Returns the number of options in the list | |
|
Returns the currently selected option(s) or checks if a specified option is selected
|
The following table lists the common properties, events, and methods of the ListBox class:
Description
Use a ListBox object to present the user with a scrollable list of items. If the multiple property is true, the user can choose more than one item. The list of options is set with the dataSource property. The list of items selected is returned by calling the selected( ) method.