Results 1 to 6 of 6

Thread: Timer Countdown

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Location
    Ontario, Canada
    Posts
    12

    Timer Countdown

    im trying to make a scorekeeping program but im having problems with the timer. Its suppose to count down in minutes and seconds from 8 minutes until it gets to 0. i cant figure out how to get the seconds. I also need a button to stop and start the clock and reset it. can anyone help me?
    Phil

  2. #2
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    VB Code:
    1. Option Explicit
    2. Dim dteStart As Date
    3.  
    4. Private Sub Command1_Click()
    5.     dteStart = DateAdd("n", 8, Now)
    6.     Timer1.Enabled = True
    7.     Timer1.Interval = 1000
    8.     Label1.Caption = "8 00"
    9. End Sub
    10.  
    11. Private Sub Timer1_Timer()
    12.     Label1.Caption = Format((dteStart - Now), "n ss")
    13.     If Label1.Caption = "0 00" Then
    14.         Timer1.Enabled = False
    15.     End If
    16. End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Location
    Ontario, Canada
    Posts
    12
    thanks! is it possible to stop the timer and then start it again where it left off?
    Phil

  4. #4
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    Check out the attached form for a full example.
    Attached Files Attached Files

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Location
    Ontario, Canada
    Posts
    12
    thank you very much, it worked perfect
    Phil

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Location
    Ontario, Canada
    Posts
    12
    thank you very much, it worked perfect
    Phil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width