Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with keypres and focus
Message
 
 
À
19/09/2003 16:24:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00830770
Message ID:
00830796
Vues:
19
Try
  CASE nKeyCode = 19 AND nShiftAltCtrl = 2  && Ctrl+S
    ThisForm.CmdSave.setfocus()
    ***ThisForm.CmdSave.click()
    KEYBOARD "{ENTER}"
Notice that you don't need LASTKEY() function because key code is passed into form's FeyPress event as nKeyCode parameter.


>Hi everyones,
>
>In the Keypress event of a form (form's base class actually) I have this piece of code:
>
>DO CASE
>  CASE LASTKEY() = 19 AND nShiftAltCtrl = 2  && Ctrl+S
>    ThisForm.CmdSave.setfocus()
>    ThisForm.CmdSave.click()
>
>
>In CmdSave.click() I do some processing and I do TxtBoxA.setfocus()
>
>When I click with the mouse, to focus goes to TxtBoxA.
>When I use Ctrl+S the process fire, TxtBoxA get the focus and then it loose it, the focus goes back to the form's grid
>
>When I try to debug, using "set step on", I see the focus goes to TxtBoxA, nothing else is done, and the focus stay there. As soon as I remove the"set step on" command, the focus doesn't stay where it should.
>
>Any ideas?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform