a textbox only accept numeric value?

ssfftt

Well-known member
Joined
Oct 27, 2005
Messages
163
Programming Experience
1-3
how can i make a textbox only accept numeric value? (e.g. integer, double or decimal)? is it possible to do it in design view? or i have to code it? To validate numeric value in coding before pass the value to further process is a pain for me, can anyone help plz?
 
or if ya dont want to make a user control you could just the KeyPress event of the textbox and use the IsNumeric function to only allow numbers the dash (-) and the period (.)

but the numericupdown control is much more suited in this case
 
if you use a boolean variable and set it in the keydown event you can use that in the keypress event to look for the ctrl + v, of course there's the context menu of the textbox too
 
Back
Top