Aarvee
Well-known member
Hi !,
In a numericupdown control, when we set the min, max, step values in design time, all these are respected when the user uses either the updown arrow keys or selects the up/down arrows in the control. However if he enters a number, these validations go out of the limits Meaning the user can enter a value which is beyond the limits specified at design time.
One way I thought I can overcome this is to trap the keypress and make sure that the user is not able to input any data except through arrow keys. While this might work ( I will have to try it) this does not seem to be very elegant. Another alternative is to validate the input in the validating event. This again is not elegant to me since in that case there is no difference between a numeric updown control and normal text box.
Is there any other way to achieve it.
Thanks in advance.
Varadarajan R
In a numericupdown control, when we set the min, max, step values in design time, all these are respected when the user uses either the updown arrow keys or selects the up/down arrows in the control. However if he enters a number, these validations go out of the limits Meaning the user can enter a value which is beyond the limits specified at design time.
One way I thought I can overcome this is to trap the keypress and make sure that the user is not able to input any data except through arrow keys. While this might work ( I will have to try it) this does not seem to be very elegant. Another alternative is to validate the input in the validating event. This again is not elegant to me since in that case there is no difference between a numeric updown control and normal text box.
Is there any other way to achieve it.
Thanks in advance.
Varadarajan R