NumericUpDown Class

Summary

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

Properties

Name Value 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 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