Skip to main content

TcxCustomSpinButton Class

Serves as the base class for classes that implement spin button editors.

Declaration

TcxCustomSpinButton = class(
    TcxCustomSpinEdit
)

Remarks

A spin button editor can be linked to another editor (a TWinControl descendant) to enable editing this editor’s value or for navigation using the keyboard or the spin buttons.

If a spin button is associated with an editor, then the latter’s value is obtained from the spin button’s Value property (0 by default). When the editor has focus, then the associated spin button handles pressing the Up, Down, Page Up, and Page Down keys. Pressing the Up key or the right/up spin button increases the edit value while pressing the Down key or the left/down spin button decreases it (increment/decrement is specified by the Properties.Increment property).

The spin button also allows fast navigation through the edit values. Fast navigation occurs when the user presses the fast buttons or the Page Up/Page Down keys. In order to enable fast buttons, set the Properties.SpinButtons.ShowFastButtons property to True. During fast navigation, the edit value is increased/decreased by the Properties.LargeIncrement property value.

Note

You should connect a spin button to editors in order to obtain full functionality. If you bind a spin button to another editor type, then you need to handle changes to its Value manually (by using the Properties.OnEditValueChanged event handler).

Note that the most obvious application of the spin button editor is to bind it to a text editor. This will allow end-users to edit the value directly or by pressing the increment/decrement and fast navigation buttons. However, this functionality is already better implemented by the TcxSpinEdit editor. Use the spin button editor when you want to associate it with something different from a basic text editor.

The TcxCustomSpinButton class implements all the functionality required by spin buttons. The derived TcxSpinButton editor simply publishes the inherited properties and events.

Do not create instances of the TcxCustomSpinButton class in applications. Use the TcxSpinButton editor to add a spin button to forms.

See Also