Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have created a c# windows application with two forms Main_form and login_form. When i run the application the main_form is executed. Now i want that if this main form is in inactive state or left unused form sometime say 5 minutes then the login_form is opened and it will ask a password..When the password is correctly entered the main_form is opened or resumed or put into focus(active state). I know how to use timer control..I just want how to get inactive state of main_form and start the timer..
Posted
Updated 17-May-12 22:29pm
v3
Comments
Stephen Hewison 17-May-12 11:54am    
Is this a windows form application? Do you control the code for the current window? If you do just start a timer set for 5 minutes, put an event on mouse down on the form, when it fires reset the timer. If the timer expires, use the timers event to open the new window.
Pete O'Hanlon 17-May-12 12:00pm    
What type of window? WPF? WinForms? Web page?
Sergey Alexandrovich Kryukov 17-May-12 12:36pm    
Why? why?!
Not even a question. What seems to be a problem? What did you try?
--SA

1 solution

Your question is too general to give a nice quick answer. As Stephen Hewison 2 suggested, you'll want to research the timer control[^] and then research the .Show and .Hide methods of the form object[^].

If you still can't figure it out, post the relevant code that your working with and ask a more specific question. Include any error message you are getting.
 
Share this answer
 
Comments
Maciej Los 17-May-12 17:21pm    
Good answer, 5!
aidin Tajadod 17-May-12 19:56pm    
my 5!

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