Windows Forms 2.0 – The NumericUpDown Control
Posted by: Suprotim Agarwal ,
on 3/22/2007,
in
Category WinForms & WinRT
Abstract: In this article, we will explore and get started with the NumericUpDown Control of Windows Forms 2.0.
Windows Forms 2.0 – The NumericUpDown Control
The NumericUpDown control allows the user to select a number that falls between a minimum and a maximum value. The NumericUpDown control primarily contains four integer properties: Minimum, Maximum, Value, and Increment.
How Do I Get Started With The NumericUpDown Control
The Minimum and Maximum properties allows you to specify the range of values for the control.The Increment value specifies the value to be incremented or decremented to the Value property when the user clicks the up or down arrow buttons. You can also control the speed of the control as it moves through numbers when the user presses the up or down arrow by setting the Accelerations property.
private void CreateNumericUpDown()
{
numericUpDown = new NumericUpDown();
// Set the Minimum, Maximum, and initial Value.
numericUpDown.Value = 0;
numericUpDown.Maximum = 220;
numericUpDown.Minimum = 0;
Controls.Add(numericUpDown);
}
Note: You can configure how values are displayed in the Windows Forms NumericUpDown control. The DecimalPlaces property determines how many numbers appear after the decimal point; the default is 0. The ThousandsSeparator property determines whether a separator will be inserted between every three decimal digits; the default is false.
Conclusion :
In this article, we took a quick overview of getting started with the NumericUpDown Control. I hope the article was useful and I thank you for viewing it.
This article has been editorially reviewed by Suprotim Agarwal.
C# and .NET have been around for a very long time, but their constant growth means there’s always more to learn.
We at DotNetCurry are very excited to announce The Absolutely Awesome Book on C# and .NET. This is a 500 pages concise technical eBook available in PDF, ePub (iPad), and Mobi (Kindle).
Organized around concepts, this Book aims to provide a concise, yet solid foundation in C# and .NET, covering C# 6.0, C# 7.0 and .NET Core, with chapters on the latest .NET Core 3.0, .NET Standard and C# 8.0 (final release) too. Use these concepts to deepen your existing knowledge of C# and .NET, to have a solid grasp of the latest in C# and .NET OR to crack your next .NET Interview.
Click here to Explore the Table of Contents or Download Sample Chapters!
Was this article worth reading? Share it with fellow developers too. Thanks!
Suprotim Agarwal, MCSD, MCAD, MCDBA, MCSE, is the founder of
DotNetCurry,
DNC Magazine for Developers,
SQLServerCurry and
DevCurry. He has also authored a couple of books
51 Recipes using jQuery with ASP.NET Controls and
The Absolutely Awesome jQuery CookBook.
Suprotim received the prestigious Microsoft MVP award for 17 consecutive years, until he resigned from the program in 2025. In a professional capacity, he is the CEO of A2Z Knowledge Visuals Pvt Ltd, a digital group that offers Digital Marketing and Branding services to businesses, both in a start-up and enterprise environment.
Get in touch with him on Twitter @suprotimagarwal or at LinkedIn