you may use one of two ways:
1) when any character except numbers in entered give a TRUE value to
e.Handled,so the event will ignore the character,and that is by comparing the
ASCII of the character with numbers ASCII.
2)but a try catch blocks and parse the textbox text to integer in try block
,so it will go to the catch block when there is charactres other than numbers
entered, now in the catch block you should empty the text property in the
textbox, the result will be emptying the textbox when non-numbers characters
are entered.
"Nick S" wrote:
Is there a simple way of only allowing numeric inputs into a textbox?
Thanks