Limit input to Text Box

P

PosseJohn

I want to limit the keys available to user to make input to a numeric field.

I want to do this be traping the KEYDOWN event.

If the user presses a key that I don't want them to use, how do I cancel the
KEYDOWN? Do I set the keycode to false?
 
S

Stuart McCall

PosseJohn said:
I want to limit the keys available to user to make input to a numeric
field.

I want to do this be traping the KEYDOWN event.

If the user presses a key that I don't want them to use, how do I cancel
the
KEYDOWN? Do I set the keycode to false?

http://www.smccall.demon.co.uk/Keyboard.htm#KeyNumeric

I recommend setting the KeyCode to 0, not False, as this implies that the
value is of boolean type, whereas it's actually an integer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top