NumericUpDown Class
Represents a Windows spin box (also known as an up-down control) that displays numeric values.
Namespace
MahApps.Metro.Controls
Base Types
  • Control
graph BT Type-->Base0["Control"] Type["NumericUpDown"] class Type type-node

Syntax

[TemplatePart(Name = PART_NumericUp, Type = typeof(RepeatButton))]
[TemplatePart(Name = PART_NumericDown, Type = typeof(RepeatButton))]
[TemplatePart(Name = PART_TextBox, Type = typeof(TextBox))]
public class NumericUpDown : Control

Attributes

Type Description
TemplatePart
TemplatePart
TemplatePart

Events

Name Type Summary
DelayChanged RoutedEventHandler
Add / Remove DelayChangedEvent handler Event which will be fired from this NumericUpDown when its delay value has been changed.
MaximumReached RoutedEventHandler
Add / Remove MaximumReachedEvent handler Event fired from this NumericUpDown when its value has reached the maximum value.
MinimumReached RoutedEventHandler
Add / Remove MinimumReachedEvent handler Event fired from this NumericUpDown when its value has reached the minimum value.
ValueChanged RoutedPropertyChangedEventHandler<double?>
Add / Remove ValueChangedEvent handler Event which will be fired from this NumericUpDown when its value has been changed.
ValueDecremented NumericUpDownChangedRoutedEventHandler
Add / Remove ValueDecrementedEvent handler Event which will be fired from this NumericUpDown when its value was decremented.
ValueIncremented NumericUpDownChangedRoutedEventHandler
Add / Remove ValueIncrementedEvent handler Event which will be fired from this NumericUpDown when its value was incremented.

Fields

Name Field Type Constant Value Summary
ButtonsAlignmentProperty DependencyProperty
Identifies the ButtonsAlignment dependency property.
static
ChangeValueOnTextChangedProperty DependencyProperty
Identifies the ChangeValueOnTextChanged dependency property.
static
CultureProperty DependencyProperty
Identifies the Culture dependency property.
static
DecimalPointCorrectionProperty DependencyProperty
Identifies the DecimalPointCorrection dependency property.
static
DelayChangedEvent RoutedEvent
Identifies the DelayChanged routed event.
static
DelayProperty DependencyProperty
Identifies the Delay dependency property.
static
HideUpDownButtonsProperty DependencyProperty
Identifies the HideUpDownButtons dependency property.
static
InterceptArrowKeysProperty DependencyProperty
Identifies the InterceptArrowKeys dependency property.
static
InterceptManualEnterProperty DependencyProperty
Identifies the InterceptManualEnter dependency property.
static
InterceptMouseWheelProperty DependencyProperty
Identifies the InterceptMouseWheel dependency property.
static
IntervalProperty DependencyProperty
Identifies the Interval dependency property.
static
IsReadOnlyProperty DependencyProperty
Identifies the IsReadOnly dependency property.
static
MaximumProperty DependencyProperty
Identifies the Maximum dependency property.
static
MaximumReachedEvent RoutedEvent
Identifies the MaximumReached routed event.
static
MinimumProperty DependencyProperty
Identifies the Minimum dependency property.
static
MinimumReachedEvent RoutedEvent
Identifies the MinimumReached routed event.
static
NumericInputModeProperty DependencyProperty
Identifies the NumericInputMode dependency property.
static
ParsingNumberStyleProperty DependencyProperty
Identifies the ParsingNumberStyle dependency property.
static
SnapToMultipleOfIntervalProperty DependencyProperty
Identifies the SnapToMultipleOfInterval dependency property.
static
SpeedupProperty DependencyProperty
Identifies the Speedup dependency property.
static
StringFormatProperty DependencyProperty
Identifies the StringFormat dependency property.
static
SwitchUpDownButtonsProperty DependencyProperty
Identifies the SwitchUpDownButtons dependency property.
static
TextAlignmentProperty DependencyProperty
Identifies the TextAlignment dependency property.
static
TrackMouseWheelWhenMouseOverProperty DependencyProperty
Identifies the TrackMouseWheelWhenMouseOver dependency property.
static
UpDownButtonsFocusableProperty DependencyProperty
Identifies the UpDownButtonsFocusable dependency property.
static
UpDownButtonsWidthProperty DependencyProperty
Identifies the UpDownButtonsWidth dependency property.
static
ValueChangedEvent RoutedEvent
Identifies the ValueChanged routed event.
static
ValueDecrementedEvent RoutedEvent
Identifies the ValueDecremented routed event.
static
ValueIncrementedEvent RoutedEvent
Identifies the ValueIncremented routed event.
static
ValueProperty DependencyProperty
Identifies the Value dependency property.
static

Properties

Name Property Type Summary
ButtonsAlignment ButtonsAlignment
The ButtonsAlignment property specifies horizontal alignment of the up/down buttons.
ChangeValueOnTextChanged bool
Gets or sets a value indicating whether the value will be changed directly on every TextBox text changed input event or when using the Enter key.
Culture CultureInfo
Gets or sets a value indicating the culture to be used in string formatting and converting operations.
DecimalPointCorrection DecimalPointCorrectionMode
Gets or sets the decimal-point correction mode. The default is Inherits
Delay int
Gets or sets the amount of time, in milliseconds, the NumericUpDown waits while the up/down button is pressed before it starts increasing/decreasing the Value for the specified Interval . The value must be non-negative.
HideUpDownButtons bool
Gets or sets a value indicating whether the up/down button of the control are visible.
InterceptArrowKeys bool
Gets or sets a value indicating whether the user can use the arrow keys Key.Up and Key.Down to change the value.
InterceptManualEnter bool
Gets or sets a value indicating whether the user can enter text in the control.
InterceptMouseWheel bool
Gets or sets a value indicating whether the user can use the mouse wheel to change the value.
Interval double
Gets or sets the interval value for increasing/decreasing the Value .
IsReadOnly bool
Gets or sets a value indicating whether the text can be changed by the use of the up or down buttons only.
Maximum double
Maximum restricts the maximum value of the Value property.
Minimum double
Minimum restricts the minimum value of the Value property.
NumericInputMode NumericInput
Gets or sets which numeric input for this NumericUpDown is allowed.
ParsingNumberStyle NumberStyles
Gets or sets the parsing number style for the value from text to numeric value.
SnapToMultipleOfInterval bool
Indicates if the NumericUpDown should round the value to the nearest possible interval when the focus moves to another element.
Speedup bool
Gets or sets a value indicating whether the value to be added to or subtracted from Value remains always Interval or if it will increase faster after pressing the up/down button/arrow some time.
StringFormat string
Gets or sets the formatting for the displaying Value
SwitchUpDownButtons bool
Gets or sets a value indicating whether the up/down buttons will be switched.
TextAlignment TextAlignment
Gets or sets the horizontal alignment of the contents inside the text box.
TrackMouseWheelWhenMouseOver bool
Gets or sets a value indicating whether the control must have the focus in order to change values using the mouse wheel.
UpDownButtonsFocusable bool
Gets or sets whether the up and down buttons will got the focus when using them.
UpDownButtonsWidth double
Gets or sets the width of the up/down buttons.
Value double?
Gets or sets the value of the NumericUpDown.

Methods

Name Return Value Summary
OnApplyTemplate() void
When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate.
OnDelayChanged(int, int) void
This method is invoked when the Delay property changes.
OnMaximumChanged(double, double) void
This method is invoked when the Maximum property changes.
OnMinimumChanged(double, double) void
This method is invoked when the Minimum property changes.
OnPreviewKeyDown(KeyEventArgs) void
OnPreviewKeyUp(KeyEventArgs) void
OnPreviewMouseWheel(MouseWheelEventArgs) void
OnPreviewTextInput(object, TextCompositionEventArgs) void
OnSpeedupChanged(bool, bool) void
This method is invoked when the Speedup property changes.
OnValueChanged(double?, double?) void
Raises the ValueChanged routed event.
SelectAll() void