TDBNumLite Control > TDBNumLite Control and Object References > TDBNumLite Spin Object Properties |
The TDBNumLite control's Spin object allows you to add a spin-up and a spin-down button to easily increment and decrement numeric entry.
The buttons can be added only on the right portion of the control, either inside or outside of the control area by using the Position property.
The properties of the Spin object can be set with the Button Property Page (TDBNumLite) at design time, and can be set with Visual Basic code at run time.
The following code demonstrates how to change the spin button appearance at run time:
Example Title |
Copy Code
|
---|---|
With TDBNumLite.Spin .Visible = dbiShowOnFocus .Position = dbiSpinPosInside End With |
When using this object, the integral or the decimal places will increment or decrement depending on where the caret is currently placed.
You can also increment past the value of the MaxValue property and start again at the value of the MinValue property, or vice versa by setting the Wrap property. The amount of the number to spin will be determined by the Increment property.
Up and Down arrow keys can be used together with the Spin object to increment and decrement values, if not assigned to the Key object properties and when the SpinKeys property is set to True. Please refer to Key Object Properties for further information.
The SpinUp and SpinDown events will be fired when clicking on the Up/Down arrow spin buttons or when pressing the Up/Down arrow keys to increment/decrement the value within the current field.
Note that clicking on the spin buttons will cause the focus to move into the edit control.