I'd like to set the max value in the Winforms NumericUpDown control to infinity. How can I do this?
I'd like to set the max value in the Winforms NumericUpDown control to infinity. How can I do this?
Setting any object's maximum to infinty is impossible.
But you can set it to the max value of your computer's capability.
If you want it the largest amount, this should work (depending on your computer's capability again):
nud.Maximum = decimal.MaxValue;
You should get the maximum 79,228,162,514,264,337,593,543,950,335 (that is a very big number!) for your
NumericUpDownif you carefully read my answer and tried my sample.If you're computer can't handle this, try replacing
decimal.MaxValuewithlong.MaxValue(Integer 64-bit), orint.MaxValue(Normal Integer).
Just replace nud with your actual NumericUpDown object name.
Regards,
Me