class SpinBox
An entryfield with a spinner for entering numeric or date values.
Syntax
[<oRef> =] new SpinBox(<container> [,<name expC>])
<oRef>
A variable or property—typically of <container>—in which to store a reference to the newly created SpinBox object.
<container>
The container—typically a Form object—to which you’re binding the SpinBox object.
<name expC>
An optional name for the SpinBox object. If not specified, the SpinBox class will auto-generate a name for the object.
Properties
The following tables list the properties, events, and methods of interest in the SpinBox class.
Property |
Default |
Description |
SPINBOX |
Identifies the object as an instance of the SpinBox class | |
true |
Whether the SpinBox object is surrounded by the border specified by borderStyle | |
SPINBOX |
Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName | |
|
The color of the text in the SpinBox object when the object has focus | |
WindowText |
The color of the text in the SpinBox object when the object does not have focus | |
|
The Field object that is linked to the SpinBox object | |
|
A text formatting function | |
|
Formatting template | |
|
The maximum value | |
|
The minimum value | |
false |
Whether the range values are enforced even when no change has been made | |
true |
Whether the entryfield contents are initially selected when the SpinBox object gets focus | |
false |
Whether the value may changed using the spinner only or typing is allowed | |
1 |
The value added or subtracted when using the spinner | |
Invalid input |
The message that is displayed when the valid event fails | |
false |
Whether to fire the valid event even when no change has been made | |
|
The value currently displayed in the SpinBox object
| |
Event |
Parameters |
Description |
<char expN>, |
When a key is pressed in the entryfield portion of the spinbox. Return value may change or cancel keystroke. | |
|
After the spinner is clicked | |
<char expN>, |
After a key has been pressed (and the key event has fired), but before the next keypress. | |
|
When attempting to remove focus. Must return true, or focus remains.
| |
Method |
Parameters |
Description |
|
Copies selected text to the Windows Clipboard | |
|
Cuts selected text to the Windows Clipboard | |
<expC> |
Simulates typed user input to the SpinBox 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 SpinBox class:
Description
Use a spinbox to let users enter values by typing them in the textbox or by clicking the spinner arrows.
By setting spinOnly to true, you can control the rate at which users change numeric or date values. For example, one spin box might change an interest rate in increments of hundredths, while another might change a date value in week increments. Set the size of each increment with the step property; for example, if you set step to 5, each click on an arrow changes a numeric value by 5 or a date value by 5 days.
To restrict entries to those within a particular range of values, set the rangeMin property to the minimum value and rangeMax to the maximum value, then set rangeRequired to true.