跳到主要内容
版本:0.10.x

NumericUpDown

The NumericUpDown is an editable numeric input field.

The control has a up and down button spinner attached, used to increment and decrement the value in the input field. The value can also be incremented or decremented using the arrow keys or the mouse wheel when the control is selected.

Reference

NumericUpDown

Source code

NumericUpDown.cs

Examples

Basic NumericUpDown

The value stored in the NumericUpDown is a double.

<NumericUpDown Value="10" Width="100"/>

produces the following output on Linux

Basic NumericUpDown

NumericUpDown with a changed increment and bounds

A custom increment/decrement value can be set for the button spinner. The default increment value is set to 1.

<NumericUpDown Value="0.5" Increment="0.01" Minimum="0" Maximum="1"/>

NumericUpDown without a button spinner

<NumericUpDown Value="42" AllowSpin="False" ShowButtonSpinner="False"/>

Common Properties

PropertyDescription
ValueThe double stored in the NumericUpDown
IncrementThe increment used by the button spinner, keyboard and mouse wheel
MinimumThe minimum allowed Value
MaximumThe maximum allowed Value
ButtonSpinnerLocationLocation of the button spinner - Left or Right
AllowSpinIf false incrementing and decrementing using the button spinner, keyboard and mouse wheel is disabled
ShowButtonSpinnerDetermines whether the button spinner should be shown