Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
KeyPress Event don't work
Message
From
16/03/1999 10:06:49
 
 
To
16/03/1999 04:21:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00197956
Message ID:
00198065
Views:
18
>>I have added several method in a formset to do Add, delete ,.etc
>>and I want to use KeyPress event to execute that method so I set the form's KeyPreview property to .T.
>>
>>I want to execute that method with Ctr + INSERT or Ctr + DELETE
>>and many more
>>
>>But when the form is running and I press the keyboard with that combination Key,... the method doesn't work
>>
>>Then I tried other approach with ON KEY LABEL but it's not work either,...
>>
>>Anybody have suggestions,..?
>>
>>TIA
>
>Set a breakpoint in the debugger just on the second line of your form.keypress, and see what keyboard codes you actually get. They may not be what you expect them, judging by the table in the help for InKey(). I've tried to trap for ctrl+k, and the keycode wasn't the expected 107 with nAltShiftCtrl of 2, it was 11,2. You could alternatively put one "Wait Window str(nKeyCode,3) time 3" instead of the breakpoint.

...............

Scenario 1: I used ctrl-Ins and ctrl-Del extensivly in VFP 5 without any problem. When I started building a new app in VFP 6, ctrl-Ins didn't work anymore. I was using VFP 6's quick menu as a starting point. I suspected that it was traping ctrl-Ins (although I couldn't find where) so I built a simple menu from scratch and the problem went away.

Scenario 2: With a VFP 6 app and a simple menu that allowed ctrl-Ins to work, I edited a parent class of something using the wonderful SuperCls utility. Imediately following, ctrl-Ins stoped working. It stayed dead until I did a fresh build (with recompile all files) then it worked again.

All anecdotal information, but it may be of use.

Bob
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform