Community discussion forum

4 hour Countdown Timer

  • 4 years ago
    Hi All,

    Anybody know how to write the program to control the 4 hour Countdown Timer? When strat run the current time will display in the label and strat display the countdown time. If the countdown timer already completed (4 hour) then will display a message. Thanks.
  • 4 years ago

    erm i havent reqally understood what it is your trying to do


    do you just what a display that counts down from 4 hours


    [4:00:00] to [0:00:00]


    yes,no,maybe??

  • 4 years ago

    yup, what i want is what you say. can you help me for the coding. thanks.

  • 4 years ago

    how soon do you need it by??
    i made it aty college earlier


    but forget to send it home to finsih it and get the code annotated and stuff,


    i can A] restart here
    or you can b] wait til 4th jan where i can e-mail you the code

  • 4 years ago

    add a timer control called tmrCounter, set its interval = 1000, enabled = true (to run) and use this code.

    Code:
    Private lngCount As Long


    Private Sub tmrCounterTimer()
       Const TIME
    COUNT = 4 * 60 * 60
       
       Let lngCount = lngCount + 1
       
       If lngCount = TIMECOUNT Then
           Let tmrCounter.Enabled = False
           Let lngCount = 0
           Msgbox "Done!", vbInformation
       Else
           Let Label1.Caption = Format$(TIME
    COUNT - lngCount, "hh:mm:ss")
       End If
    End Sub


  • 4 years ago

    Look at the "High-Performance Timer Objects" at click here
    It has a countdown timer with tick event and timer event.
    You can set the tick event to ocurr every second and the timer event will ocurr when the timer reaches 0.
    Miguel

  • 4 years ago

    to be honest, that's a bit pointless when the code's so short anyway. it's best to stick to standard VB controls or make your own ones when necessary.

  • 4 years ago

    Quote:
    [1]Posted by alexreg on 19 Dec 2004 09:22 AM[/1]
    to be honest, that's a bit pointless when the code's so short anyway. it's best to stick to standard VB controls or make your own ones when necessary.


    The CCRP timer is far better than the intrinsic timer.
    1) It doesn't need a form.
    2) The resulution is 1 mSec.
    3) The period in not limited by an integer.
    4) It returns the time elapsed
    5) Is usefull for benchmarking.


    So , the advantage of using it is far beyond the solution of rebinas problem.

  • 4 years ago

    hmm...that's your opinion.
    i can give you a 50-line class of mine that practically does all that.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!