Show / Hide Table of Contents

Class NumericUpDown

Represents a control that enables single value selection from a numeric range of values through a Spinner and TextBox.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Control
UpDownBase
UpDownBase<System.Double>
NumericUpDown
Inherited Members
UpDownBase<Double>.Value
UpDownBase<Double>.ValueProperty
UpDownBase<Double>.IsEditable
UpDownBase<Double>.IsEditableProperty
UpDownBase<Double>.ValueChanging
UpDownBase<Double>.ValueChanged
UpDownBase<Double>.Parsing
UpDownBase<Double>.ParseError
UpDownBase<Double>.GetValue()
UpDownBase<Double>.SetValue(Object)
UpDownBase<Double>.OnKeyDown(KeyEventArgs)
UpDownBase<Double>.OnMouseWheel(MouseWheelEventArgs)
UpDownBase<Double>.ApplyValue(String)
UpDownBase<Double>.OnParseError(UpDownParseErrorEventArgs)
UpDownBase<Double>.OnParsing(UpDownParsingEventArgs<Double>)
UpDownBase<Double>.OnSpin(SpinEventArgs)
UpDownBase<Double>.OnIsEditableChanged(Boolean, Boolean)
UpDownBase<Double>.SelectAllText()
UpDownBase.SpinnerStyle
UpDownBase.SpinnerStyleProperty
UpDownBase.OnSpinnerStyleChanged(Style, Style)
Control.EnableBaseControlHandlingOfVisualStates
Control.ManageIsEnabled(Boolean)
Control.Background
Control.BackgroundProperty
Control.BorderBrush
Control.BorderBrushProperty
Control.BorderThickness
Control.BorderThicknessProperty
Control.FontWeight
Control.FontWeightProperty
Control.FontStyle
Control.FontStyleProperty
Control.Foreground
Control.ForegroundProperty
Control.FontFamily
Control.FontFamilyProperty
Control.FontSize
Control.FontSizeProperty
Control.TextDecorations
Control.TextDecorationsProperty
Control.Padding
Control.PaddingProperty
Control.HorizontalContentAlignment
Control.HorizontalContentAlignmentProperty
Control.VerticalContentAlignment
Control.VerticalContentAlignmentProperty
Control.TabIndex
Control.TabIndexProperty
Control.IsTabStop
Control.IsTabStopProperty
Control.TabNavigation
Control.TabNavigationProperty
Control.Template
Control.TemplateProperty
Control.ApplyTemplate()
Control.GetTemplateChild(String)
Control.Focus()
Control.HandlesScrolling
Control.OnGotFocus(RoutedEventArgs)
Control.OnLostFocus(RoutedEventArgs)
Control.CreateDomElement(Object, Object)
Control.CharacterSpacingProperty
Control.CharacterSpacing
Control.FontStretchProperty
Control.FontStretch
Control.OnDrop(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnTextInputUpdate(TextCompositionEventArgs)
Control.MeasureOverride(Size)
Control.ArrangeOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.LogicalChildren
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Input.Toolkit.dll
Syntax
[TemplatePart(Name = "Text", Type = typeof(TextBox))]
[TemplatePart(Name = "Spinner", Type = typeof(Spinner))]
[StyleTypedProperty(Property = "SpinnerStyle", StyleTargetType = typeof(ButtonSpinner))]
public class NumericUpDown : UpDownBase<double>, IControl, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

NumericUpDown()

Initializes a new instance of the NumericUpDown class.

Declaration
public NumericUpDown()

Fields

| Improve this Doc View Source

DecimalPlacesProperty

Identifies the DecimalPlaces dependency property.

Declaration
public static readonly DependencyProperty DecimalPlacesProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

IncrementProperty

Identifies the Increment dependency property.

Declaration
public static readonly DependencyProperty IncrementProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

MaximumProperty

Identifies the Maximum dependency property.

Declaration
public static readonly DependencyProperty MaximumProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

MinimumProperty

Identifies the Minimum dependency property.

Declaration
public static readonly DependencyProperty MinimumProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

DecimalPlaces

Gets or sets the number of decimal places that are displayed in the NumericUpDown.

Declaration
public int DecimalPlaces { get; set; }
Property Value
Type Description
System.Int32
Remarks

The default value is zero.

DecimalPlaces decides output format of Value property. It is implemented via formatString field and FormatValue override.

| Improve this Doc View Source

Increment

Gets or sets a value added or subtracted from the value property.

Declaration
public double Increment { get; set; }
Property Value
Type Description
System.Double
Remarks

The default values is one.

| Improve this Doc View Source

Maximum

Gets or sets the Maximum possible Value.

Declaration
public double Maximum { get; set; }
Property Value
Type Description
System.Double
Remarks

The default values is one.

| Improve this Doc View Source

Minimum

Gets or sets the Minimum possible Value.

Declaration
public double Minimum { get; set; }
Property Value
Type Description
System.Double
Remarks

The default value is zero.

Methods

| Improve this Doc View Source

FormatValue()

Provides decimal specific value formatting for the value property.

Declaration
protected override string FormatValue()
Returns
Type Description
System.String

Formatted Value.

Overrides
System.Windows.Controls.UpDownBase<System.Double>.FormatValue()
| Improve this Doc View Source

OnApplyTemplate()

Builds the visual tree for the NumericUpDown control when a new template is applied.

Declaration
public override void OnApplyTemplate()
Overrides
System.Windows.Controls.UpDownBase<System.Double>.OnApplyTemplate()
| Improve this Doc View Source

OnCreateAutomationPeer()

Returns a NumericUpDownAutomationPeer for use by the Silverlight automation infrastructure.

Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type Description
AutomationPeer

A NumericUpDownAutomationPeer object for the NumericUpDown.

Overrides
UIElement.OnCreateAutomationPeer()
| Improve this Doc View Source

OnDecimalPlacesChanged(Int32, Int32)

Called when the DecimalPlaces property value has changed.

Declaration
protected virtual void OnDecimalPlacesChanged(int oldValue, int newValue)
Parameters
Type Name Description
System.Int32 oldValue

Old value of the DecimalPlaces property.

System.Int32 newValue

New value of the DecimalPlaces property.

| Improve this Doc View Source

OnDecrement()

Called by OnSpin when the spin direction is SpinDirection.Decrease.

Declaration
protected override void OnDecrement()
Overrides
System.Windows.Controls.UpDownBase<System.Double>.OnDecrement()
| Improve this Doc View Source

OnIncrement()

Called by OnSpin when the spin direction is SpinDirection.Increase.

Declaration
protected override void OnIncrement()
Overrides
System.Windows.Controls.UpDownBase<System.Double>.OnIncrement()
| Improve this Doc View Source

OnIncrementChanged(Double, Double)

Called when the Increment property value has changed.

Declaration
protected virtual void OnIncrementChanged(double oldValue, double newValue)
Parameters
Type Name Description
System.Double oldValue

Old value of the Increment property.

System.Double newValue

New value of the Increment property.

| Improve this Doc View Source

OnMaximumChanged(Double, Double)

Called when the Maximum property value has changed.

Declaration
protected virtual void OnMaximumChanged(double oldValue, double newValue)
Parameters
Type Name Description
System.Double oldValue

Old value of the Maximum property.

System.Double newValue

New value of the Maximum property.

| Improve this Doc View Source

OnMinimumChanged(Double, Double)

Called when the Minimum property value has changed.

Declaration
protected virtual void OnMinimumChanged(double oldValue, double newValue)
Parameters
Type Name Description
System.Double oldValue

Old value of the Minimum property.

System.Double newValue

New value of the Minimum property.

| Improve this Doc View Source

OnValueChanged(RoutedPropertyChangedEventArgs<Double>)

Override UpDownBase<T>.OnValueChanged to raise value changed automation event and determine if a maximum or minimum has been reached.

Declaration
protected override void OnValueChanged(RoutedPropertyChangedEventArgs<double> e)
Parameters
Type Name Description
RoutedPropertyChangedEventArgs<System.Double> e

Event args.

Overrides
System.Windows.Controls.UpDownBase<System.Double>.OnValueChanged(System.Windows.RoutedPropertyChangedEventArgs<System.Double>)
| Improve this Doc View Source

OnValueChanging(RoutedPropertyChangingEventArgs<Double>)

Override UpDownBase<T>.OnValueChanging to do validation and coercion.

Declaration
protected override void OnValueChanging(RoutedPropertyChangingEventArgs<double> e)
Parameters
Type Name Description
RoutedPropertyChangingEventArgs<System.Double> e

Event args.

Overrides
System.Windows.Controls.UpDownBase<System.Double>.OnValueChanging(System.Windows.Controls.RoutedPropertyChangingEventArgs<System.Double>)
| Improve this Doc View Source

ParseValue(String)

Called by ApplyValue to parse user input as a decimal number.

Declaration
protected override double ParseValue(string text)
Parameters
Type Name Description
System.String text

User input.

Returns
Type Description
System.Double

Value parsed from user input.

Overrides
System.Windows.Controls.UpDownBase<System.Double>.ParseValue(System.String)

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source