Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enter in a text box
Message
 
 
À
18/07/2000 12:03:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00393414
Message ID:
00393892
Vues:
15
>I screwed this up. I called the keypress event from the valid event. So I was still getting the problem that I couldn't cancel when I tested my program more. How do I call the keypress event of my textbox?
>
>This is what I had
>
>Valid event
>
>this.keypress(lastkey())
>
>Keypress event
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>
>if nKeyCode = 13
> if(add2list())
> thisform.text1.value = right('00000'+alltrim(str(recno("tmplist")+1)),5)+':'
> thisform.list1.requery()
> else
> this.value = ""
> endif
>endif
>
>Thanks,
>Tyler


You don't need to call keypress from valid - NEVER DO THIS . If you do this, you screw up the sequence of events. KeyPress is an EVENT (not method) and it called automatically while you're typing something on keyboard.
Put in keypress
wait window 'nKeyCode '+transform(nKeyCode)+chr(13)+;
'nShiftAltCtrl'+transform(nShiftAltCtrl)

so you will see the actual codes.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform