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
MaximumReached RoutedEventHandler
Event fired from this NumericUpDown when its value has reached the maximum value
MinimumReached RoutedEventHandler
Event fired from this NumericUpDown when its value has reached the minimum value
ValueChanged RoutedPropertyChangedEventHandler<double?>
ValueDecremented NumericUpDownChangedRoutedEventHandler
ValueIncremented NumericUpDownChangedRoutedEventHandler

Fields

Properties

Name Value Summary
ButtonsAlignment ButtonsAlignment
ChangeValueOnTextChanged bool
Gets or sets a value indicating whether the value will be changed directly on every TextBox text changed event or when using the Enter key.
Culture CultureInfo
Gets or sets a value indicating the culture to be used in string formatting operations.
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 +/- button of the control is visible.
InterceptArrowKeys bool
Gets or sets a value indicating whether the user can use the arrow keys Key.Up and Key.Down to change values.
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 values.
Interval double
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
Minimum double
NumericInputMode NumericInput
Gets or sets which numeric input for the NumericUpDown is allowed.
ParsingNumberStyle NumberStyles
Gets or sets the parsing number style for the value from text to numeric.
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 are switched.
TextAlignment TextAlignment
Gets or sets the horizontal alignment of the contents of 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. If the value is true then the value changes when the mouse wheel is over the control. If the value is false then the value changes only if the control has the focus. If is set to "false" then this property has no effect.
UpDownButtonsFocusable bool
Gets or sets whether the up and down buttons will got the focus when using them.
UpDownButtonsWidth double
Value double?

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
OnMaximumChanged(double, double) void
OnMinimumChanged(double, double) void
OnPreviewKeyDown(KeyEventArgs) void
OnPreviewKeyUp(KeyEventArgs) void
OnPreviewMouseWheel(MouseWheelEventArgs) void
OnPreviewTextInput(object, TextCompositionEventArgs) void
OnSpeedupChanged(bool, bool) void
OnValueChanged(double?, double?) void
Raises the ValueChanged routed event.
SelectAll() void