For something a little fancier try playing with the following. Each time a digit is pressed, it saves the current (before inserting the new digit) in the Tag property. This is used to undo the newest digit if the resulting value exceeds some threshhold.