ComponentOne True DBInput Pro 8.0
TDBNumber Spin Object Properties

The TDBNumber control's Spin object allows you to add a spin-up and a spin-down button to the control to increment and decrement for 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 (TDBNumber) at design time, and can be set with Visual Basic code at run time.

The following code demonstrates how to change the Spin object's appearance at run time:

Example Title
Copy Code
With TDBNumber.Spin

    .Visible = dbiShowOnFocus

    .Position = dbiSpinPosInside

End With

When using this object in either the integral or the decimal places, the current caret placement determines whether the number will increment or decrement. If the caret is placed on a literal, the spin action will be ignored and not take effect.

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.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback