Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a sort of *LASTKEY()* for the mouse ?
Message
From
14/08/2000 18:34:16
 
 
To
14/08/2000 17:31:41
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00404395
Message ID:
00404755
Views:
12
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform