The NumericUpDown control is located in the ToolBox along with the TextBox, Label, ComboBox, WebBrowser.
This control is very useful when a numeric value needs to be gotten from the user, the control can be set to allow numbers within a specified range and can be set to allow any number of decimal places.
Instead of finding and modifying code that will force the standard TextBox to accept numbers only (and worse, only 1 decimal) and instead of trying to make a currency mask for the masked textbox, simply drag and drop a NUD on the form, set a couple of properties and you're done.
When it comes to be time to grab the value from the control, there's no conversion from String to Double/Decimal, the NUD already has a Value property which is of type Decimal. Much more flexible than a TextBox forcing numeric input.
For more info on the control visit: NumericUpDown Class (System.Windows.Forms)
Here's a screen shot with the control highlighted.
This control is very useful when a numeric value needs to be gotten from the user, the control can be set to allow numbers within a specified range and can be set to allow any number of decimal places.
Instead of finding and modifying code that will force the standard TextBox to accept numbers only (and worse, only 1 decimal) and instead of trying to make a currency mask for the masked textbox, simply drag and drop a NUD on the form, set a couple of properties and you're done.
When it comes to be time to grab the value from the control, there's no conversion from String to Double/Decimal, the NUD already has a Value property which is of type Decimal. Much more flexible than a TextBox forcing numeric input.
For more info on the control visit: NumericUpDown Class (System.Windows.Forms)
Here's a screen shot with the control highlighted.