Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keypress problems
Message
From
14/12/1998 00:47:01
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00167079
Message ID:
00167084
Views:
23
>In a Keypress method of a form I have a case statement like the following (snippet)...
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>DO CASE
>CASE nKeyCode = 19 AND nShiftAltCtrl = 2
>ThisForm.cmdSave.Click()
>NODEFAULT
>CASE nKeyCode = 21 AND nShiftAltCtrl = 2
>ThisForm.cmdUndo.Click()
>NODEFAULT
>.
>.
>.
>OTHERWISE
>DODEFAULT()
>ENDCASE
>
>... which works fine for the keys in the case statement, like Ctrl S for save. However, with this code in use I have two problems:
>
>1. Pressing Tab skips over fields on the form, like every other one. The tab order is set correctly. When I Shift Tab it moves through every field. If I comment out the Keypress code Tab moves through the form perfectly.
>
>2. While tabbing through the fields (skipping like above) I hit an error "Property Value is not found." on some of the combo boxes on the form. The combo boxes are pretty standard, with no unusual code in their methods. Again, if I comment out the Keypress code this error does not appear.
>
>Any ideas on what is going on with this Keypress method? I do not have any code in the Keypress specific to the Tab key.
>
>Thanks.

FoxPro's DEFAULT KeyPress code needs to receive the parameters just like the code above does. Replace DODEFAULT() with DODEFAULT(nKeyCode, nShiftAltCtrl) and give it another try.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform