2010-08-15, 09:09 PM
With that NumberBox, the user can still right-click and paste anything into it. A better solution imo is to allow anything to be typed, validate the text whenever you need to use it, and if you want to be fancy, indicate invalid inputs visually with a different color or something. There's also the built-in NumericUpDown control. It lets you paste in non-numeric text but reverts it when it loses focus.

