hi all,
I have a NumericUpDown control. The minimum value is 1 and the maximum value is 99. I want to prevent the user from entering a value bigger then 100. Currently if you enter 100, after validating the control return to the maximum value. I want to prevent the user from entering 100. The use may enter 98, 99, ... Anyone have an idea on how to do that? What event to use ? I've already searched the net and didn't find anything.
Or anyone have any idea to make the user only capable of entering two digits?
Thank you very much
Michael
NumericUpdown: make user unable to enter value bigger then 99
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Ehab11 reputationPosted Mar 5, 2010, 1:07 AM EST
You could do something like: in the NumericUpDown events, double click the KeyUp event. In it, you could write a code to the effect you want. For example:
private void numericUpDown1_KeyUp(object sender, KeyEventArgs e)
{
}
Let me know if it works for you :)
Sam HobbsRank #107 · 20.5K reputationPosted Mar 5, 2010, 8:17 AM EST