Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Need a code to close the application after specific time

Need a code to close the application after specific time

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Neo_Ali
    wrote on last edited by
    #1

    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

    C K 2 Replies Last reply
    0
    • N Neo_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

      C Offline
      C Offline
      CWIZO
      wrote on last edited by
      #2

      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!

      N 1 Reply Last reply
      0
      • N Neo_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

        K Offline
        K Offline
        Kanniah
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • C CWIZO

          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!

          N Offline
          N Offline
          Neo_Ali
          wrote on last edited by
          #4

          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

          C 1 Reply Last reply
          0
          • N Neo_Ali

            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

            C Offline
            C Offline
            CWIZO
            wrote on last edited by
            #5

            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!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups