Results 1 to 3 of 3

Thread: keeping time!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Wales
    Posts
    12

    Post

    I know this might sound stupid... But i have just started using VB(i am only 15) and I was wondering how to show time in a label counting down from 5 minutes. Thank you a lot for your time.
    P.S. I am not an expert so please use human language.

    Michael Baynham

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Code:
    Private Sub Form_Load()
        Timer1.Interval = 500
    End Sub
    
    Private Sub Timer1_Timer()
        Static tTimer As Single
        
        If tTimer = 0 Then tTimer = Timer
        If (Timer - tTimer) > 300 Then Exit Sub
        Label1 = Format(DateAdd("s", 300 - (Timer - tTimer), Date), "nn:ss")
        
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Wales
    Posts
    12

    Post

    Thank you very much for your time.

    Michael Baynham

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