views:

464

answers:

3

C#: 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?

+10  A: 

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

Stevo3000
+1 but I had to read the question and answer a few times before I understood that you meant that he should set the maximum value to the MaxValue. Maybe I just need to drink some more coffee...
wcm
I don't know who down voted, but wtf?
Stevo3000
+3  A: 
NumericUpDown1.Maximum = Decimal.MaxValue;
Patrick McDonald
+4  A: 

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.

TheTXI