Global Application Events
-
Hi, I have a C# application which I need to recognize any user activity within the application only. This I do for the reason of timeout after zero activity. in the appliction I have differnet usercontrols. what I would like is when ever the user press key ,move mouse , or click to reset a timer. and if there is zero activity whith 20min to throw in a msg. tnks, Leeoze
-
Hi, I have a C# application which I need to recognize any user activity within the application only. This I do for the reason of timeout after zero activity. in the appliction I have differnet usercontrols. what I would like is when ever the user press key ,move mouse , or click to reset a timer. and if there is zero activity whith 20min to throw in a msg. tnks, Leeoze
I'm not aware of a global event that does that. You'll have to respond to all the different events that you want to treat as activity, and call code to reset your timer from there. on a From there is a property called KeyPreview. If you set this to true, then key presses on controls on the form will also trigger the key events on the form as well. This will save you responding to key events on all controls. (There is an Application.Idle event that gets fired whenever the application has finished processing and is about to become idle. I don't think that will help you though)
Simon
-
Hi, I have a C# application which I need to recognize any user activity within the application only. This I do for the reason of timeout after zero activity. in the appliction I have differnet usercontrols. what I would like is when ever the user press key ,move mouse , or click to reset a timer. and if there is zero activity whith 20min to throw in a msg. tnks, Leeoze
All you need is a timer that counts down from 20m to 0 then reset the timer to 20 in each event (e.g. mouse move, button click, ...) when the timer reach 0, fire your msg
Mohammed Gouda foreach(Minute m in MyLife) myExperience++;
-
I'm not aware of a global event that does that. You'll have to respond to all the different events that you want to treat as activity, and call code to reset your timer from there. on a From there is a property called KeyPreview. If you set this to true, then key presses on controls on the form will also trigger the key events on the form as well. This will save you responding to key events on all controls. (There is an Application.Idle event that gets fired whenever the application has finished processing and is about to become idle. I don't think that will help you though)
Simon
-
Cool. Just don't do lots of processing in the Application.Idle because it gets fired everytime the app is about to go idle, so you'll just max out your cpu if you put lots of work in it because it will just keep getting called over and over.
Simon
-
Cool. Just don't do lots of processing in the Application.Idle because it gets fired everytime the app is about to go idle, so you'll just max out your cpu if you put lots of work in it because it will just keep getting called over and over.
Simon
if you use timer to count down then in each Tick the App fire the Idle event. then I would suggest not to count down rether use the intreval and fire your event on the Tick; Plus since there is cross-threading issue use Bool (i.e. ISTiCked) to set whether it has been ticked and in ur App.Idle even fucntion check for (true/fals) in ISTiCked.