How can I return the key?, mean if I want to allow only integer values in the textbox, how can I don’t allow user to not enter non-integers, regarding, KeyPress event, I know there are other ways such as expression to match the string value, but I want to not assign invalid value to the textbox.
if (( value >0 a&&(value <=9)) then
assigned
else
return
Use the Handled Property
Example from MSDN: link