TDBNumber Control > Features of the TDBNumber Control |
This section describes the following TDBNumber control features:
Formatting Styles
Data binding feature
Automatic character filtering
Drop down calculator
Color display for negative numbers
Range checking
Action keys
TDBNumber provides formats for positive and negative values as well as zero and Null values. Additionally, the display format is separated from the input format, making it possible to display numbers in complex formats with yet with easy input.
For example, by using the DisplayFormat and Format properties, large currencies can be displayed as $1,234.00, yet the user has only to enter "1234", thereby saving keystrokes and eliminating the need for Visual Basic code.
The data bound functionality, which is supported by Visual Basic, is now also supported by the TDBNumber control. With data binding, a number value can be retrieved from any field in the database and displayed in the control, and entered number values can be stored into the database.
TDBNumber controls reduce coding time with automatic character filtering for allowable characters, (numeric, numeric symbols), and number validation. The TDBNumber control's number validation feature eliminates character-by-character validation for nonnumeric characters during data entry, thereby reducing coding time.
The TDBNumber control's drop down calculator provides for easy calculation and entry at run time using the Calculator object. For example, a user may want to calculate hours worked over a 14 day period, and by using the drop down calculator, will be able to acquire the sum without checking an alternate source. The user can access the drop down calculator by clicking the down arrow button set using the DropDown object, or by pressing a key defined in the Key:controls object’s property as an action key.
To use the calculator, the user may click on the buttons using a mouse, or enter the appropriate keys using the keyboard. If the ENTER key is pressed, a calculation will be performed if an operation is pending. If not, whatever is in the calculator’s view window will be applied to the TDBNumber control.
By setting the NegativeColor property in the TDBNumber control, negative numbers can be displayed in color.
The TDBNumber control provides for range checking with the MinValue and MaxValue properties when moving the focus to a different control. This provides for validation of value entry, and will not allow the user to enter a value that is out of the allowed range. For example, hours worked during a fourteen day period can be required to fall between 1 and 140; all other values will be invalid.
TDBNumber provides action keys to contribute to a more efficient run time. You can customize navigation by setting the properties in the Key object. The DropDown property in the Key object can define a key to bring up the drop down calculator.