Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

4 hour Countdown Timer

Last post 12-20-2004 2:21 AM by alexreg. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 12-16-2004 5:47 PM

    • rebina
    • Not Ranked
    • Joined on 12-14-2004
    • New Member
    • Points 130

    4 hour Countdown Timer

    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.
    • Post Points: 20
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 12-17-2004 12:27 AM In reply to

    4 hour Countdown Timer

    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??
    feel fre to e-mail me at:drogonevets@gmail.com

    enjoy and God bless!!
    • Post Points: 5
  • 12-17-2004 12:52 AM In reply to

    • rebina
    • Not Ranked
    • Joined on 12-14-2004
    • New Member
    • Points 130

    4 hour Countdown Timer

    yup, what i want is what you say. can you help me for the coding. thanks.
    • Post Points: 5
  • 12-17-2004 8:02 AM In reply to

    4 hour Countdown Timer

    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
    feel fre to e-mail me at:drogonevets@gmail.com

    enjoy and God bless!!
    • Post Points: 5
  • 12-17-2004 8:51 AM In reply to

    • alexreg
    • Top 25 Contributor
    • Joined on 10-22-2001
    • Guru
    • Points 8,695

    4 hour Countdown Timer

    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 tmrCounter_Timer()
       Const TIME_COUNT = 4 * 60 * 60
       
       Let lngCount = lngCount + 1
       
       If lngCount = TIME_COUNT 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

    • Post Points: 5
  • 12-19-2004 8:41 AM In reply to

    • MiguelS
    • Top 500 Contributor
    • Joined on 11-08-2002
    • Member
    • Points 275

    4 hour Countdown Timer

    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
    • Post Points: 5
  • 12-19-2004 9:22 AM In reply to

    • alexreg
    • Top 25 Contributor
    • Joined on 10-22-2001
    • Guru
    • Points 8,695

    Wink [;)] 4 hour Countdown Timer

    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.
    • Post Points: 5
  • 12-19-2004 9:41 PM In reply to

    • MiguelS
    • Top 500 Contributor
    • Joined on 11-08-2002
    • Member
    • Points 275

    4 hour Countdown Timer

    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.
    • Post Points: 5
  • 12-20-2004 2:21 AM In reply to

    • alexreg
    • Top 25 Contributor
    • Joined on 10-22-2001
    • Guru
    • Points 8,695

    Wink [;)] 4 hour Countdown Timer

    hmm...that's your opinion.
    i can give you a 50-line class of mine that practically does all that.
    • Post Points: 5
Page 1 of 1 (9 items)