Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programming function keys
Message
 
À
01/10/1997 01:23:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00052580
Message ID:
00052749
Vues:
31
>pressing F2 = append new record
> F4 = delete record
> F5 = skip back
> F6 = skip forward
> F7 = goto bottom
> F8 = goto top
>etc. ...
Marc,

I would suggest that you NOT use ON KEY LABEL as those are intercommand interrupts and they could fire during other code running and cause major problems. I would suggest the following as a way of doing what you want.

Use the keypress event of your formclass a=with KeyPreview set to .T. In the keypress event you can check for the keycodes (ascii numbers) for the keys you want trapped, issue a NODEFAULT and then call teh appropriate method of the form to do the work.

* Form KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
DO CASE
CASE nKeyCode = -1 && F2
NODEFAULT
THISFORM.AddNew()
CASE nKeyCode = -3 && F4
NODEFAULT
THISFORM.DelRec()
CASE nKeyCode = -4 && F5
NODEFAULT
THISFORM.GoPrevious()
CASE nKeyCode = -5 && F6
NODEFAULT
THISFORM.GoNext()
CASE nKeyCode = -6 && F7
NODEFAULT
THISFORM.GoBottom()
CASE nKeyCode = -7 && F8
NODEFAULT
THISFORM.GoTop()
ENDCASE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform