class ComboBox
A component on a form which can be temporarily expanded to show a list from which you can pick a single item.
Syntax
[<oRef> =] new ComboBox(<container> [,<name expC>])
<oRef>
A variable or property—typically of <container>—in which to store a reference to the newly created ComboBox object.
<container>
The container—typically a Form object—to which you’re binding the ComboBox object.
<name expC>
An optional name for the ComboBox object. If not specified, the ComboBox class will auto-generate a name for the object.
Properties
The following tables list the properties, events, and methods of the ComboBox class.
Property |
Default |
Description |
false |
Whether the drop-down list automatically drops down when the combobox gets focus | |
COMBOBOX |
Identifies the object as an instance of the ComboBox class | |
COMBOBOX |
Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName | |
WindowText |
The color of the text in the ComboBox object when it has focus | |
WindowText |
The color of the text in the ComboBox object when it does not have focus | |
|
The Field object that is linked to the ComboBox object | |
|
The option strings of the ComboBox object | |
|
The height of the drop-down list in the form's current metric units. | |
|
The width of the drop-down list in the form’s current metric units | |
|
Specifies the maximum number of characters allowed. | |
true |
Whether the selectAll behavior is used in the entry field portion of the ComboBox | |
false |
Whether the options are sorted | |
DropDown |
The style of the ComboBox: 0=Simple, 1=DropDown, 2=DropDownList | |
|
The value of the currently selected option
| |
Event |
Parameters |
Description |
|
Fires just before dropdown list is closed for a style 1 or 2 combobox | |
|
Fires just before dropdown list opens for a style 1 or 2 combobox | |
|
For a style 0 or 1 combobox, fires for each keystroke that modifies the value of the combobox, just before the new value is displayed | |
<char expN>, |
When a key is pressed. Return value may change or cancel keystroke. | |
|
Fires after the string in the ComboBox object has changed and the ComboBox object loses focus, but before onLostFocus | |
|
Fires when the user takes an action that closes the dropdown list without choosing an item from the list for a style 1 or 2 combobox | |
|
Fires when the user takes an action to choose an item from the list such as by left clicking the mouse on an item or pressing Enter with an item highlighted. | |
|
For a style 0 or 1 combobox, fires for each keystroke that modifies the value of the combobox, just after the new value is displayed | |
<char expN>,
|
After a key has been pressed (and the key event has fired), but before the next keypress. | |
Method |
Parameters |
Description |
|
Copies selected text to the Windows clipboard | |
|
Cuts selected text to the Windows clipboard | |
<expC> |
Simulates typed user input to the ComboBox object | |
|
Copies text from the Windows clipboard to the current cursor position | |
|
Reverses the effects of the most recent cut( ), copy( ), or paste( ) action
|
The following table lists the common properties, events, and methods of the ComboBox class:
Description
Use a ComboBox object when you want the user to pick one item from a list. When the user is not choosing an item, the list is not visible. The list of options is set with the dataSource property.
If a ComboBox is dataLinked to a field object that has implemented its lookupSQL or lookupRowset properties, the ComboBox will automatically be populated with the appropriate lookup values, and store the corresponding key values in the dataLinked field.