Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with function keys/keypress event on form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00688790
Message ID:
00688797
Vues:
14
>Hi - i am wanting to assign function keys to various code in my form class so that F1 moves to first record F2 to the previous record etc
>I have got this all working except in one instance. I have a case statement in the keypress of my form class and the keypreview property is set .t.
>
>case nKeyCode == -5 && f6 save
>.mSaveChanges()
>
>The problem is this - if I make changes to text in a textbox and leave the cursor in that textbox then press F6 I loose my changes even though my save routine is getting called - I always seem to loose the changes made to the textbox last edited (the one that the cursor is in when I press F6) - but if I use my save button on the form the changes are saved ok - i have "set confirm on" so I think the problem is that the textbox is not losing focus and the valid not getting called etc. I am not sure how to get it working correctly. Any ideas appreciated!

Would it help if you force the textbox to lose the focus (e.g. by setting focus to the save button) ?
case nKeyCode == -5 && f6 save
     .cmdSave.Setfocus() && force textbox to lose focus
     .mSaveChanges()
     && add code here to restore focus to original control.     
Hector Correa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform