---
title: "NumericUpDown Control in C#.Net"  
description: "The NumericUpDown Control in C#.NetThe NumericUpDown control provides a way to select a number that falls between a minimum and a maximum value. Th"  
author: "Pushpendra Singh"  
published: 2011-01-24  
updated: 2020-07-14  
canonical: https://www.mindstick.com/articles/409/numericupdown-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# NumericUpDown Control in C#.Net

## The NumericUpDown Control in C#.Net

The [NumericUpDown](https://www.mindstick.com/forum/442/validation-on-numericupdown-control-in-c-sharp-dot-net) control provides a way to select a number that falls between a minimum and a [maximum value](https://answers.mindstick.com/qa/38240/according-to-recent-rbi-directives-to-banks-how-many-pieces-of-soiled-currency-notes-with-a-maximum-value-of-rs-5-000-can-be-exchanged-at-banks-free-of-charge).

The numeric value can be incremented or decremented by clicking the up or [down buttons of the control](https://www.mindstick.com/Articles/1118/using-reportviewer-in-winforms-c-sharp). The user can also enter a value.\

## \
How to use NumericUpDown Control

[Drag and drop](https://www.mindstick.com/forum/454/how-to-drag-and-drop-multiple-image-from-one-canvas-to-onther-canvas-in-html5) NumericUpDown Control and a textbox from the toolbox on [window Form](https://www.mindstick.com/forum/527/how-to-pass-datagridview-s-cells-value-to-another-window-form).

![NumericUpDown Control in C#.Net](https://www.mindstick.com/mindstickarticle/473b0e70-92a5-4285-8230-1f40a2cb2377/images/40dfd0c7-3d84-4937-b7c5-ab71a462dd52.png)

#### Code: Write code on the ValueChanged event of NumericUpDown control.

![NumericUpDown Control in C#.Net](https://www.mindstick.com/mindstickarticle/473b0e70-92a5-4285-8230-1f40a2cb2377/images/977241ce-b313-48ef-ba3e-bd48446963d8.png)

[Double click](https://www.mindstick.com/forum/156225/differentiate-between-google-adword-and-double-click) on ValueChanged event.

```
private void numericUpDown1_ValueChanged(object sender,  EventArgs e){            //selected value will show in TextBox            textBox1.Text = numericUpDown1.Value.ToString();}
```

**Run the project**

![NumericUpDown Control in C#.Net](https://www.mindstick.com/mindstickarticle/473b0e70-92a5-4285-8230-1f40a2cb2377/images/206a1795-1786-47a2-ad45-40abbc3cf7bc.png)

When you will run the project the initial value of NumericUpDown will be 0. Now when you change the value of NumericUpDown then changed value will also show in textbox.

![NumericUpDown Control in C#.Net](https://www.mindstick.com/mindstickarticle/473b0e70-92a5-4285-8230-1f40a2cb2377/images/449e66d3-7549-4f21-816e-a9dd6e706129.png)

**NumericUpDown Control [Properties](https://yourviews.mindstick.com/view/81845/now-it-s-possible-to-predict-properties-of-any-molecule)**

**DecimalPlaces:** Set the number of [decimal places](https://www.mindstick.com/forum/33881/round-double-type-variable-to-two-decimal-places-in-c-sharp) to display in NumericUpDown Control.

**UpDownAlign:** Set positions the arrow buttons on the left or the right side of the NumericUpDown. The [default value](https://www.mindstick.com/forum/23023/default-value-when-using-singleordefault) is Right.

**Increment:** Gets or sets the value to increment or decrement the NumericUpDown.

## Example:

```
private void frmNumericUpDown_Load(object sender,  EventArgs e){         //Increment the NumericUpDown value          numericUpDown1.Increment = 5;}
```

NumericUpDown value will be incremented 5 at each up [button click](https://www.mindstick.com/forum/568/check-condion-before-post-page-on-button-click-in-jquery-or-javascript).

![NumericUpDown Control in C#.Net](https://www.mindstick.com/mindstickarticle/473b0e70-92a5-4285-8230-1f40a2cb2377/images/3df2d614-acb1-4195-a502-ffb673bc9065.png)

**Hexadecimal** : Hexadecimal property used to show value in Hexadecimal format in NumericUpDown. The default value is false.

## Example:

```
private void frmNumericUpDown_Load(object sender, EventArgs e){            // allow to show value in Hexadecimal format              numericUpDown1.Hexadecimal = true;}
```

![NumericUpDown Control in C#.Net](https://www.mindstick.com/mindstickarticle/473b0e70-92a5-4285-8230-1f40a2cb2377/images/23d02bc9-d5dc-4d47-96bd-3ce1c070e0b0.png)\

---

Original Source: https://www.mindstick.com/articles/409/numericupdown-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
