Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numeric only handling ???? 1

Status
Not open for further replies.

keithinuk

Technical User
May 14, 2002
56
0
0
GB
Hello
Just a quickie (I hope).
I've got a range of numeric only text boxes which I'm trying to handle. I can track which keys are pressed in the Keypress event but can't suppress none numeric and navigational key strokes.

In earlier VB I set the key stroke to zero and nothing was entered. Blowed if I can see how to do it in .net !!!!!!!!!

Any ideas please ????

Thanks in advance
Keith In case I forget to say "Thank you" I'll say it now - thank you for your help !!!
 
The keystroke event has a boolean parameter called cancel I believe. Simply set that value to false and the keystroke will be cancelled. (I am away from my desk but I think that is how I remember doing it.) That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
It's taken just over a year to report that it worked.
Lost my job in May 2003 so I don't care now :):):):)

Thanks anyway
Keith

In case I forget to say 'Thank you' I'll say it now - thank you for your help !!!
 
just for reference you can add
e.handled = true
that will stop the keystroke from firing on the form
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top