Information générale
Catégorie:
Codage, syntaxe et commandes
>I am using a grid for data entry. Every control on the grid is marked ReadOnly = .T., TabStop = .F. except for the one I want the user to utilize.
>
>I want / to move the user to the next record; -- moves back one record. I have the following code in the KeyPress event:
>
>IF nKeyCode = 13 .OR. nKeyCode = 9
> THIS.LostFocus() && Calc. & display the premium
> SKIP
> IF EOF()
> WAIT WINDOW AT 20,20 "Last advice on file for target date."
> SKIP -1
> ENDIF
> This.SetFocus()
>ENDIF
>IF nKeyCode = 15 && Shift--tab
> THIS.LostFocus()
> SKIP -1 IN Transact
> IF BOF()
> WAIT WINDOW AT 20,20 "First advice on file for target date."
> ENDIF
> THIS.SetFocus()
>ENDIF
>
>Doesn't work. All it does is wipe out the user's input and shift focus to the next column to the right. If I press the , everything works beautifully. What have I done wrong in my code? How can I make and emulate the key?
I think that all you need is:
DO CASE
CASE nKeyCode = 13 .OR. nKeyCode = 9
KEYBOARD "{DNARROW}"
CASE nKeyCode = 15
KEYBOARD "{UPARROW}"
ENDCASE
Vlad
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement