Information générale
Catégorie:
Codage, syntaxe et commandes
This is a perfect situation for a Global App Object. You instantiate this prior to calling your first Form and attch the Timer to it. Set the Timer's interval to whatever and decide what criteria to use to determine Inactivity. It will always be measuring elapsed time regardless of which Form is running, since it is Global to all.
HTH,
-Irv.
>Hi all,
> I need a way to check for no user activity for a given period of time anywhere in the program. If the time is exceeded then I have to load a password screen. Loading the password screen is very easy. The hard part is finding a way to check for the inactivity.
>
> I could put a timer in the 1st screen that is always loaded and create a small function to reset the timer using the keypress event of my form base class but that seems like a lot of overhead. I would also have to go back through all my screens and make sure I have dodefault() in any that I use the keypress in. (And that is a whole lot of screens, over 150.)
>
>Anyone got a better idea?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement