Hi,

I'm using a NumericUpDown control on a properties dialog. I've set the Max and Min limits to 1 and 250. The idea is that the user selects a value in that range, clicks the OK button and the value gets passed to the calling code.


The problem is this: If the user types in 999 (using the keyboard, not the spin buttons) then clicks ok the NumericUpDown control's text and value properties are both 250 and this is what gets passed to the calling code.

I need to find a way of trapping these invalid entries.

The two approaches I've already thought of (but don't like are these)
1. Make the control ReadOnly so that values can't be typed (or pasted) in directly
2. Monitor the ValueChanged / TextChanged events - I don't like this because if the user wants to change "100" to "110" it throws up an error message for a transitory "1100".


Any ideas?