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:
00823434
Views:
24
Note I have not tested this with a Top-Level Form, but try the following code in the KeyPress of the form:
LPARAMETERS nKeyCode, nShiftAltCtrl
THISFORM.Timer1.Enabled = .f.
DODEFAULT(nKeyCode, nShiftAltCtrl)
THISFORM.Timer1.Enabled = .t.
NODEFAULT
Leave the timer interval at 5000, and set the KeyPreview property of the form to .T. You may or may not need the DODEFAULT/NODEFAULT lines of code.

>Hi all,
>
>I wanna get this:
>A Top-Level form is activated (DO FORM myForm) and _SCRREN.Visible is OFF.
>myForm have a lot of controls. After 5 seconds of inactivity INSIDE myForm, it must be closed.
>
>I tryed it with a Timer with Interval 0 and "Thisform.Hide()" in the Timer Event.... In the myForm.LostFocus(), "this.Timer1.Interval = 5000" And in the myForm.GotFocus(), "this.Timer1.Interval = 0".
>But... it don't works....
>
>In summary, I wanna get the same effect like MSN Messenger popup windows.
>
>Thanks in advance.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform