Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a sort of *LASTKEY()* for the mouse ?
Message
De
14/08/2000 18:34:16
 
 
À
14/08/2000 17:31:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00404395
Message ID:
00404755
Vues:
13
>I've always thought it would be cool if I could know what control was about to get focus (within the control that currently has focus), regardless of how the focus is being changed (ie: mouse, keyboard, or programmatic).

Well, this is the only way I can think of off hand, maybe something to add to your framework, who knows:

Programmatic: In the baseclass of all your controls, add this to SetFocus:

thisform.oProgrammaticMoveFocus = this

and in the GotFocus .NULL. it out. You can look at this property in the Valid to tell you where focus is going next, since the SetFocus() method finishes before the Valid() of the current control fires.

Mouse: If oProgrammaticMoveFocus is NULL, you'll know it was either a keyboard or mouse, you can test for mouse with MDown() and then grabbing sys(1270).

Keyboard: Otherwise, you can test in the valid f lastkey was enter, backspace, tab or back tab, pass This.TabOrder + or - 1 (depending on the key) to find the next control (remember to test for containership)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform