Saturday, May 13, 2006

force number input in .NET



This built-in function can be used to force user to input numbers:

if (!char.IsNumber(e.KeyPress))
messagebox.show("plz enter numbers only")

also, "decimal.tryparse" can be used to check if the input is a number after input

No comments: