Adding a timer in VB.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Musty
    New Member
    • Feb 2008
    • 15

    Adding a timer in VB.NET

    hi there

    I've just finished programming an application that is a 20 question multiple-choice test - but would very much like a timer that enables it so shut down automatically after say, 15 or 10 minutes.

    I'm currently using Microsoft Visual Studio 2003 and programming with VB.NET, does this feature exist?

    Thanks in advance guys and gals.
  • balabaster
    Recognized Expert Contributor
    • Mar 2007
    • 798

    #2
    Originally posted by Musty
    hi there

    I've just finished programming an application that is a 20 question multiple-choice test - but would very much like a timer that enables it so shut down automatically after say, 15 or 10 minutes.

    I'm currently using Microsoft Visual Studio 2003 and programming with VB.NET, does this feature exist?

    Thanks in advance guys and gals.
    Dump a timer object on your form, set the interval to (15 * 60 * 1000) (15 minutes) and in the timer_elapsed event, write code to save the results to the database so you don't lose them and then run the following code to close your application.

    Environment.Exi t(0)

    Comment

    • Musty
      New Member
      • Feb 2008
      • 15

      #3
      Adding a timer in VB.NET

      Hello, I recently completed a 20 question multiple choice test using Microsoft Visual Studio 2003, and now wish to add a timer function to it which exits the application automatically after say, 10 minutes once the test has started.

      I understand that Microsoft Visual Studio already has the 'timer' function, but how do I use it, how would I set it to leave the exit the application after 10 minutes, and, how do I display the timer for the user to see whilst they're doing the test?

      Thanks in advance!

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        The two threads were rather close and should have only been a single question.
        Merged.
        MODERATOR

        Comment

        • Musty
          New Member
          • Feb 2008
          • 15

          #5
          hi

          thanks for the advice but:

          how does one start up a 'time elapsed' event? Sorry this is probly a dumb question but do you mean via private sub? In which case what would it be do u have any example source code for this?

          Thanks

          Comment

          Working...