SpinEdit Class

An editor with spin buttons used to adjust a numerical value.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v20.2.dll

Declaration

public class SpinEdit :
    ButtonEdit
Public Class SpinEdit
    Inherits ButtonEdit

Remarks

The SpinEdit class are a text editor with a pair of spin buttons that end users can click to adjust a value. Spin buttons are used to increment or decrement the editor's value displayed in the text edit region.

WPF SpinEdit Control

TIP

The SpinEdit class inherits its features from the ButtonEdit class.

Refer to the ButtonEdit class description for information on derived features and API.

Create a SpinEdit

The spin editor's value is specified with the SpinEdit.Value property.

<Window ...
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">

<!-- Specify value using the TextEditBase.Text property -->
<dxe:SpinEdit Value="8" Increment="0.5" MinValue="0" MaxValue="10" AllowSpinOnMouseWheel="False" />

Handle the BaseEdit.EditValueChanged event to get a notification when the editor's value is changed. To validate the new value, handle the BaseEdit.Validate event.

Value Edit Options

The editor's increment value, by which the edit value is changed every time the editor is spun, is specified by the SpinEdit.Increment property.

The editor's value can be integer or floating-point. Use the SpinEdit.IsFloatValue property to specify the editor's value type.

Minimum and Maximum Values

The minimum and maximum allowed values are specified by the SpinEdit.MinValue and SpinEdit.MaxValue properties, respectively. Use the SpinEdit.Minimize or SpinEdit.Maximize method to set the editor's value to the minimum or maximum value, respectively.

Useful API:

Mouse Wheel Input

End-users can modify the SpinEdit's value with a mouse wheel.

Set the SpinEdit's TextEdit.AllowSpinOnMouseWheel property to true to allow users to spin a mouse wheel to change an edit value. This property is in effect only when the TextEdit.AllowSpin property is true.

Appearance Customization

TIP

Refer to the following topic for more information: Appearance Customization.

See Also