I have to allow a user to select a whole number between 10 and 30. I was planning on using a numericUpDown control. As soon as the user clicks on my "OK" button, the value is stored in the My.Settings and the form is disposed.
As I tested my code, I tried entering a value that was out of range. I learned that if I enter a number such as 50, (too high), the value of the NumericUpDown simple goes to the maximum value (in this case 30). If I enter a value of 5 (too low), the NumericUpDown simply goes to the minimum value (in this case 10). Now that maximum number or minimum number is stored in the My.Settings.
Is there a way to disable the user from entering a value from the keyboard and limit him to only use the up and down arrows on the control.
Or, is there some other way for me to capture that he put in a value that is out of range and allow him to correct the mistake?