Skip to main content

TcxDBSpinEdit Class

Represents a spin editor, which enables editing numerical dataset fields.

Declaration

TcxDBSpinEdit = class(
    TcxCustomSpinEdit
)

Remarks

A spin editor is a control that enables editing numerical values by clicking so-called “spin buttons” (up and down arrows displayed within an editor). They allow incrementing and decrementing a number by some amount (integer or floating-point). It is also possible to enter a value directly by typing it. The following image demonstrates a spin editor painted using the UltraFlat style:

The DataBinding property allows you to connect an editor to a dataset. To do this, you have to set the DataSource and DataField members of the DataBinding property.

TcxDBSpinEdit is similar to the TcxSpinEdit control except that it is designed to edit numerical (integer or floating point) dataset fields. To access a value displayed by a spin editor, use the Value property. It specifies the currently edited value. When a user either exits the editor or presses the Enter key, this value is stored in the EditValue property.

The Properties object defines different settings specific to spin editors. The Increment member defines the number by which a specific value is changed every time a user clicks spin buttons or presses the Up and Down keys (if the UseCtrlIncrement property is set to True, the Up and Down keys must be combined with the Ctrl key). Use the MaxValue and MinValue properties to limit the numbers which a spin editor can represent. They define the range of acceptable values. A spin editor can represent either integer or double values. The ValueType property controls the type of spin edit value and specifies the manner in which the increment number is interpreted. It is possible to prohibit users from editing values directly. Set the CanEdit property to False to restrict the user to change a value by clicking a spin button or by pressing the Up/Down keys (or the Ctrl-Up, Ctrl-Down keys). The Properties object provides an OnChange event, which is generated every time the display value changes.

To adjust style attributes use the Style, StyleDisabled, StyleFocused and StyleHot properties. Working with styles is discussed in the TcxCustomEditStyle class topic.

See Also