UI Toolbox logoUI Toolbox

NumericUpDown

A NumericUpDown is a number field with up and down buttons. Its value is a double.

<UIToolbox.NumericUpDown label="Qty" value="10" min-value="0" max-value="100" step="5" />
<UIToolbox.NumericUpDown label="Price" step="0.01" format-string="F2" />
<UIToolbox.NumericUpDown label="Cost" format-string="$#,0.00;($#,0.00)" />
<UIToolbox.NumericUpDown label="Tax" min-value="0" max-value="1" step="0.005" format-string="P1" />
Member Description
MinValue (min-value), MaxValue (max-value) The range. The value is clamped. A minimum above the maximum moves the maximum, and the other way around.
Step (step) How much a button, a key or a wheel notch changes the value (1).
FormatString (format-string) A .NET numeric format for the text, such as F2, N0, P1 or $#,0.00. The text uses the invariant culture.
TryParseText(text, out number) Reads a number in the look of FormatString, as the field does with typed text. Returns false for other text, such as an expression.
Increment(), Decrement() Change the value by Step.

Styling

The rules are in Assets/UIToolbox/Runtime/Resources/UIToolbox/Styles/Controls.uss.

Class Element
tb-numeric-up-down The field.
tb-numeric-up-down__field The inner DoubleField.
tb-numeric-up-down__spinner The button column.
tb-numeric-up-down__up, tb-numeric-up-down__down The buttons (RepeatButton).