Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cant get rid of keystrokes when using keypress event
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00122304
Message ID:
00122310
Views:
18
Add the following code to the keypress event to "eat" the "V" or "v" keystroke:
if nKeyCode = 118 or nKeyCode = 86
	nodefault
endif
The nodefault command prevents the default action from occuring in an event.

>I am using the keypress event in a form to trap for keystroks that then run the click event of a command button. In this case I want to trap for the V key so the user does not have to hit ALT+V . All works well in launching the form. Problem is, when comming back to a form after running another form that keypress seems to still be in a buffer and it runs the form a second time. If I use the mouse on the command button it all works ok. I have tried everything I know to get rid of that keystroke. I have tried clear typeahead, wait window, do while chrsaw() etc. I have also tried setting focus to the grid I am using for a picklist thinking that the command button still has the focus. Any ideas out there???
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform