Can I make the maximum value of a NumericUpDown co

2019-03-17 22:52发布

问题:

As the title says, is there a way to make the maximum value of a NumericUpDown control unlimited instead of having to specify a specific value its the Maximum property?

回答1:

Set the NumericUpDown Maximum property to the MaxValue property of the data type it is representing.



回答2:

NumericUpDown1.Maximum = Decimal.MaxValue;


回答3:

You cannot set the property to unlimited or infinity or anything like that, but you can use the MaxValue of the data type you are using (Integer.MaxValue, Decimal.MaxValue, etc.) which will give you as far a range as possible without incurring overflow errors.