but with the masked textbox you have to specify the number of digits that it can accept ( the format string ), where as the numeric up down allows you to accept any number in the decimal data type range.
Printable View
but with the masked textbox you have to specify the number of digits that it can accept ( the format string ), where as the numeric up down allows you to accept any number in the decimal data type range.
Using KeyDown event is better than using KeyPress event in this case, since when you'll use KeyDown, you won't see an unlegall text on your textbox - even not for less than a second. Unlegall characters will be handled before, and that's, I guess, solves the ugliness problem.