General information
Category:
Coding, syntax & commands
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only