Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling a Key Press
Message
 
To
14/12/1999 11:24:02
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00303395
Message ID:
00303526
Views:
21
>re: disable the "-" key
>
>On key label - Do Nothing
>
>Procedure Nothing
>Return && Nothing

Michael,

First ON KEY LABEL - * will do this without a dummy function delcaration.

Second, this is not a good way to handle this situation. ON KEY is an intercommand interrupt which is global in scoipe, that is it will prevent the key from being processed anywhere.

Third, good encapsulation dictates that the textbox should handle the key strokes internally, using the KeyPress event is exactly what the KeyPress is for.

Also, as an intercommand interrupt, OKL's can have severe and devastating side effects. The OKL routine will interrupt running code and can cause all kinds of side effect problems. It is much better to handle things in a KeyPress evetn where the event doesn't fire unless the context is right for a key to be pressed. Of course teh exception to this rule is when you need and intercommand interrupt.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform