Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
KeyPreview--no control.KeyPress
Message
De
10/04/2006 18:40:30
 
 
À
10/04/2006 15:33:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01112147
Message ID:
01112218
Vues:
16
>I'm working on a form that has KeyPreview set to .T. and code in the form-level KeyPress. I'm finding that in some circumstances, the control's KeyPress doesn't fire after the form's KeyPress. In particular, it happens when I press Tab in a textbox on this form. The result in this case is that the next control in tab order is receiving the tab key, and focus is jumping two controls.
>
>Both the form and textbox are based on subclasses and I can't duplicate this with base classes, so I know it's something I'm doing.
>
>The code in the form class's KeyPress looks like this:
>
>
>IF This.TestSomething(nKeyCode)
>   This.DoSomething()
>ENDIF
>
>DODEFAULT(nKeyCode, nShiftAltCtrl)
>
>
>In my testing, This.TestSomething() is returning .F., as it should, so This.DoSomething() is never called.
>
>To see what's happening, I've used event tracking as well as DEBUGOUT in the form and control KeyPress events.
>
>Any ideas what could suppress the control KeyPress at this level?
>
>Tamar

Remove dodef(), VFP execute the form::keypress code after the form's keypress end.

Another, different, way is to add a nodefault
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform