Results 1 to 7 of 7

Thread: timer troubles

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Ohio
    Posts
    8

    Smile timer troubles

    I'm working on a timer program and am having trouble writing the code to make a timer count down from a number that the user would enter. Any one have suggetions???

    Thanks!
    Raye...

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    seconds? minutes?

    seconds:

    enteredtime = wherever it comes from (textbox...inputbox)

    set timer1.interval = 1000 (1000 per second)


    Private Sub timer1_timer()
    enteredtime = enteredtime - 1
    label1 = enteredtime
    end sub

    minutes set timer interval = 60000
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Ohio
    Posts
    8

    need timer to show minutes and seconds...

    Hi again!

    I need my timer to show minutes and seconds as it counts down. Syntax for that??? My book's section explaining timers and date/time syntax is terrible...

    Raye...
    Raye...

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    VB Code:
    1. Dim tm As Integer
    2. Private Sub Form_Load()
    3. Timer1.Interval = 1000
    4. tm = InputBox("enter minutes")
    5. tm = tm * 60
    6. End Sub
    7.  
    8. Private Sub Timer1_Timer()
    9. tm = tm - 1
    10. Label1 = Int(tm / 60) & ":" & (tm Mod 60)
    11. End Sub

    just a sample...
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Ohio
    Posts
    8

    Thanks!

    Thanks for the help!
    Raye...

  6. #6
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Code:
    Label1 = Int(tm / 60) & ":" & (tm Mod 60) ;)

  7. #7
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    How to

    Let's say "pno" is the time of now. which is the command "Time".
    so

    Dim pno as string
    pno = Time

    and if the user haven't set the Current Form to Focus, in 5 minutes, the MSGBOX will popup.

    How do you do that, Expert?

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

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