>i dont use classes, i have only a principal form with command button, textbox, combo.
>Now you say that every time the user click on a command or type in a text box or do something over controls i have to reset the timer at the 5 minuts.
>In this way j have to control all the controls over the form right??Yes. For example, code in the txtBox.InteractiveChange() resets the timer.
This is an example of what the framework I use (VMP) has in InteractiveChange():
IF VARTYPE(oApp) = "O"
oApp.SetLastUserActivity()
ENDIF
SetLastUserActivity() is called by InteractiveChange() in all controls and all it does is basically resetting the timer.
Note: You should use classes and OOP. Else you are re-inventing the wheel every time you create a new program. One of the main advantages of Object Oriented Programming is reusability. In this example, you would have to add the codeto every textbox you use in every form, today and tommorrow on the next form. If you create your own txtBox class that already has this code (this behavior) in it, all you have to do is drop an instance of your textbox, instead of VFP's base textbox and it already works! If you also used a subclass of the base form that has the timer code, all your programs will inherit this behavior without any more work!