Click here to Skip to main content
15,888,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am doing an application. It is going to be implemented in a touchscreen machine.
If the user is not doing anything ie if the screen is untouched for 1 minute, it should automatically go back to the welcome screen.I dont have any idea of doing it.
Can anyone please help me? Thanks..
Posted

1 solution

Use a timer control and set it's interval to 60000, and have a bool Touched;


C#
bool Touched = false;


private void timer1_Tick(object sender, EventArgs e)
        {
             if(!Touched)
{
              //Go back to home screen
}
        }



When the user touches the screen set Touched to true and add this

C#
Touched = false;
timer1.Stop();
timer1.Start();
 
Share this answer
 
Comments
lilian87 26-May-12 4:19am    
Where to add timer.stop and timer.start?
ZaiDz 26-May-12 16:37pm    
Touched = false;
timer1.Stop();
timer1.Start();

That resets the timer back to 0

So whenever you want to reset the timer just add that code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900