Need a code to close the application after specific time
-
please help me with code which i can use to shutdown the application after 30mints, my application contains multi-forms and i want this code to be run when i click the start button on the second form "Form2". Please note that i'm using the following code under the next or back buttons to switch between forms < unload me Form3.show > as for example if i put timing code in Form2 , will this code stop when i click the next button which contains the code above? Please advise and thank you for your help Ali
-
please help me with code which i can use to shutdown the application after 30mints, my application contains multi-forms and i want this code to be run when i click the start button on the second form "Form2". Please note that i'm using the following code under the next or back buttons to switch between forms < unload me Form3.show > as for example if i put timing code in Form2 , will this code stop when i click the next button which contains the code above? Please advise and thank you for your help Ali
Record the time when the user clicks on the "Start" button and start a timer (with a 1 minute interval) that will check the current time against the recorded one and close the application if 30 minutes have elapsed.
-------------------------------------------------------- My portfolio & development blog Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!
-
please help me with code which i can use to shutdown the application after 30mints, my application contains multi-forms and i want this code to be run when i click the start button on the second form "Form2". Please note that i'm using the following code under the next or back buttons to switch between forms < unload me Form3.show > as for example if i put timing code in Form2 , will this code stop when i click the next button which contains the code above? Please advise and thank you for your help Ali
Hi This is the first time I am replying a query. All the Best!. Unless you unload the form that contains the Timer control you can keep count of the ticks. In the timer control event you check for the period after which you want to close the application. If it is visual basic, you can use this code, Close All End If it is vb.net Application.Exit Hope this helps you. Kanniah
-
Record the time when the user clicks on the "Start" button and start a timer (with a 1 minute interval) that will check the current time against the recorded one and close the application if 30 minutes have elapsed.
-------------------------------------------------------- My portfolio & development blog Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!
-
This is a very smart way , but how can i record the time from the system clock and what will be the data type for the variable which i will store the time in it to compare with the current type. Please advise and thank you for your help. Ali
Have a look at the System.DateTime class.
-------------------------------------------------------- My portfolio & development blog Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!