Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

Please tell me how to redirect from one windows form to another after some time if the page is ideal in windows application.

Thank you
Posted
Comments
DamithSL 17-Dec-14 22:34pm    
you mean idle?
please elaborate more on how you define idle in your application context and also what have you tried so far?
Black_Rose 17-Dec-14 22:38pm    
sorry.idle means suppose a user left the application at middle at some form and left, then after 5-10 sec it should redirect to the main form.
BillWoodruff 18-Dec-14 0:15am    
I join with Damith in asking you for more information.

There are several ways you could define "idle," including just meaning that a certain period of time has passed where your entire Application has had no mouse, or keyboard, activity.

In this case I think what you want is to detect a lack of activity in a certain open Form of your Application, but keep in mind that if you have more than one Form, and the user makes another Form the ActiveForm, then the inactive Form no longer receives messages from keyboard or mouse.

Clarify, please.

refer below for how you can detect idle time of user
http://forum.codecall.net/topic/69801-user-idle-detection/[^]
Getting the user idle time with C#[^]
you can use timer and check the idle time in each tick event and if the user is idle for more than given time then you can close or hide your main form and open another form.
 
Share this answer
 
Comments
BillWoodruff 18-Dec-14 0:15am    
+5 This is a good answer ! But, I'm not sure the OP here wants to detect overall Application idle time. Hopefully, the OP will let us know what they want.
Use Timer UserControl and use Tick event to trigger method such as form2.Show() and this.form.Hide()
 
Share this answer
 

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