Hi, I have implemented something very similar to what you describe with a timer to detect inactivity.
Rather than create click events for every object to reset the timer, I have placed the reset to be called within the code that gets executed when the user does something in the app. My app has a search button to run a search on a database. The reset is triggered in: a) The code that does the search b) The load event when a user switches to another form Doing a reset of the timer in the Load_event for the form and within the code that gets executed when user does some action is the best you can really do. Joe --- In [email protected], "t2thecathp" <t2theca...@...> wrote: > > I want to run code if the user is inactive for a period of time. But I am > having a hard time detecting inactivity. > > I tried creating a timer that will get reset whenever the user clicks on > something, but the problem is that click events don't bubble up through the > interface (as would happen in Flash, for example). > > So I can create a sub called Output_Click. But as soon as a form is drawn, > Output_Click won't receive click events any more. > > I can create a sub called Form1_Click. But as soon as I add content to the > form (like a button, text, image, etc), it won't receive click events unless > I click on a blank space that doesn't have content. > > The only solution I can think of is add 'sub whatever_Click' for every visual > component on every form. But that is a bad solution. > > Also, none of this will work for key press events, which should also reset an > inactivity timer. > > Is there a more elegant way to do this? > > Or, is there a way to trigger an event when the backlight turns off? The > backlight seems to be pretty reliable at determining inactivity. > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en -~----------~----~----~----~------~----~------~--~---
