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 or 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 number of options displayed in the drop-down list | |
|
The width of the drop-down list in the form’s current metric units | |
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 |
<char expN>, |
When a key is pressed. Return value may change or cancel keystroke. | |
|
After the string in the ComboBox object has changed and the ComboBox object loses focus, but before onLostFocus | |
<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.