Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto Close Form on Inactivity
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00823423
Message ID:
00823459
Views:
22
This message has been marked as the solution to the initial question of the thread.
BINDEVENT of the form's MouseMove to a custom method does work, but you need to add a dummy parameter line to your custom method similar to what is in the original MouseMove event -- "LPARAMETERS nButton, nShift, nXCoord, nYCoord" -- otherwise you get a parameter statement not found error. Now, the MouseMove of the form only fires when the mouse is moved over empty areas of the form. If the mouse moves over an object on the form, the form MouseMove does not fire. I would think this would be good enough since the user is likely to move across the form as well as an object within your 5 seconds. Otherwise, you need to loop through the form controls and issue a BINDEVENT on each of their MouseMove events to your custom method. This is not particularly difficult to do:
FOR EACH loControl in THIS.Objects && THIS could be the form, grid, etc.
    IF PEMSTATUS(loControl, 'MouseMove', 5)
       BINDEVENT(loControl, 'MouseMove', THISFORM, 'MyMouseMoveMethod')
    ENDIF
ENDFOR
For PageFrames, Grids and other container objects, you would have to run the above code for each of those objects as well.

>OK... works well when no keys pressed in the form, but... what about the mouse events ?
>
>Any way to capture it simpler than write the same code on MouseMove event of each control on the form and in the controls in the cointainers?? this form have a lot of controls.... May be something like BindEvents ?? Or exist something like KeyPreview for Mouse events ( "MousePreview" :) )
>
>Thanks again
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform