Jan 16 2004, 04:22 PM
How to triger a Timer if no any actions on current form (eg. no keystroke,no mouse movement...)
Jan 16 2004, 05:05 PM
Can you be more specific.
For example there is a standard function which allows you to activate a timer when the form opens.
Jan 16 2004, 06:53 PM
Just for security issues, let's say, I set a Timer period as 5 minuts, if user didn't do anything in 5 mminuts, the Timer will be trigerd, the warning message will be displayed, but, here is a but, if user did do something, like moved mouse, enterd keyboard, the Timer should be reset every time user does something.
Something Like Windows Screen Saver\Power\Advanced tab\Options, "Prompt for password when computer goes off standby"
Jan 17 2004, 01:51 AM
Any one know how to code in VB event procedure for the scenario discribed below:
Set a Timer period as 5 minuts, if user didn't do anything in 5 mminuts, the Timer will be trigerd, the warning message will be displayed, but, here is a but, if user did do anything (like move mouse, enter keyboard), the Timer should be reset every time user does something
Jan 17 2004, 05:04 AM
try something like:
for each relevant event;
(Click, dblClick, MouseMove, KeyPress should catch most that you need) insert the code
Me.TimerInterval = X
Where X represents the number of miliseconds you want the delay between no action and a password prompt
In the OnTimer event
place the code to ask for and verify the password
Jan 17 2004, 11:38 AM
Thanks for the reply, are those event form's event or all control's on that form. If I have twenty something controls on the form, do I need to code for each one of them?
Jan 17 2004, 11:57 AM
No. You should only have to do it on the form. As soon as it picks up the mouse moving, being clicked or a key being hit it should reset the timer interval (something like 300,000) will give you 5 minutes)
Jan 17 2004, 12:39 PM
Thank you Jim.
I tried, but if I do something on any one of those controls instead of form itself during timer interval, Timer still being trigerd, I guess I have to code for every control and form.
Jan 17 2004, 04:19 PM
I tested it and it seems to work. Can you zip and post the Db?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here