Countdown/pause/resume timer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JimJam

    #1

    Countdown/pause/resume timer

    Hello Peeps

    I have created a program in VB.NET 2003 that counts down from 7.5 hours to
    zero from 08:00. I have a button that starts a new countdown from 1 hour to
    zero whilst the first one is couting down from 7.5 hours.

    How do I pause that time that is counting down from 1 hour & behind a new
    button restart it without losing one second?

    I would also like the time to count down from 37 hours, but will pause after
    7.5 hours until 08:00 the next day.

    Here's a recap:

    1) Time now counting every second
    2) Time from 08:00 + 7.5 hours counting down (16:30 to 08:00)
    3) 1 Hour starting from a button press counting down to zero
    4) Another button which can pause the 1 hour countdown (see 3 above)
    5) Timer that starts at 08:00 on Monday counting down from 37 hours, which
    pauses each day at 16:30 & restarts the next day at 08:00 until it reaches
    00:00 (Friday afternoon at 16:30)

    Four labels:

    Label 1 = number 1 above (example: Dim dt As DateTime =
    DateTime.Now.To LongTimeString : Label1.Text = dt.ToString)
    Label 2 = number 2 above
    Label 3 = number 3 & 4 above
    Label 4 = number 5 above

    Any ideas as Im pulling my hair out over this one

    TIA

    JimJam


  • Homer J Simpson

    #2
    Re: Countdown/pause/resume timer


    "JimJam" <jim_jam@slimfa stplan.cheap> wrote in message
    news:udXXiDvPGH A.2816@TK2MSFTN GP15.phx.gbl...
    [color=blue]
    > I have created a program in VB.NET 2003 that counts down from 7.5 hours to
    > zero from 08:00. I have a button that starts a new countdown from 1 hour
    > to
    > zero whilst the first one is couting down from 7.5 hours.
    >
    > How do I pause that time that is counting down from 1 hour & behind a new
    > button restart it without losing one second?[/color]

    This is VERY hard to follow!



    Comment

    • Cerebrus

      #3
      Re: Countdown/pause/resume timer

      He he !

      Well, atleast I wasn't the only one who couldn't make head or tail of
      the question.

      Regards,

      Cerebrus.

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Countdown/pause/resume timer

        JimJam,

        In my idea is this just use the DateTime, in that the method
        DateTime.AddWha tever(negative) and this in a normal form timer event that
        you have dragged on your form.

        However I don't start a sample for you, that you have to do yourself.

        I hope this helps,

        Cor

        "JimJam" <jim_jam@slimfa stplan.cheap> schreef in bericht
        news:udXXiDvPGH A.2816@TK2MSFTN GP15.phx.gbl...[color=blue]
        > Hello Peeps
        >
        > I have created a program in VB.NET 2003 that counts down from 7.5 hours to
        > zero from 08:00. I have a button that starts a new countdown from 1 hour
        > to
        > zero whilst the first one is couting down from 7.5 hours.
        >
        > How do I pause that time that is counting down from 1 hour & behind a new
        > button restart it without losing one second?
        >
        > I would also like the time to count down from 37 hours, but will pause
        > after
        > 7.5 hours until 08:00 the next day.
        >
        > Here's a recap:
        >
        > 1) Time now counting every second
        > 2) Time from 08:00 + 7.5 hours counting down (16:30 to 08:00)
        > 3) 1 Hour starting from a button press counting down to zero
        > 4) Another button which can pause the 1 hour countdown (see 3 above)
        > 5) Timer that starts at 08:00 on Monday counting down from 37 hours, which
        > pauses each day at 16:30 & restarts the next day at 08:00 until it reaches
        > 00:00 (Friday afternoon at 16:30)
        >
        > Four labels:
        >
        > Label 1 = number 1 above (example: Dim dt As DateTime =
        > DateTime.Now.To LongTimeString : Label1.Text = dt.ToString)
        > Label 2 = number 2 above
        > Label 3 = number 3 & 4 above
        > Label 4 = number 5 above
        >
        > Any ideas as Im pulling my hair out over this one
        >
        > TIA
        >
        > JimJam
        >
        >[/color]


        Comment

        Working...