Jump to content

How to setup a count down timer?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
MSIE

MSIE

    Newbie

  • Members
  • Pip
  • 1 posts
Any code snippets that count down from current date till the end of the month?

#2
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
I think you got your answer here:
count down timer till end of the month - VBForums
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.

#3
johnpitter

johnpitter

    Newbie

  • Members
  • Pip
  • 1 posts
I think this code will help you.

Dim elapsed As Long, temptime As Long


Private Sub Command1_Click()

Timer1.Enabled = True

temptime =Hour(now()* 3600+ Minute(Now() * 60 + Second(Now())) + 30 ' this is for 30 seconds. change this to your need

Label1 = temptime

End Sub


Private Sub Timer1_Timer()

 elapsed = Hour(now()*3600 +Minute(Now() * 60 + Second(Now()))


 Label2 = elapsed

Label3 = (temptime - elapsed) & "Seconds"

 If elapsed = temptime Then

 MsgBox ("over")

 Timer1.Enabled = False

 End If

 End Sub

Edited by Roger, 28 January 2011 - 11:02 PM.
removed links, added code block


#4
solnoy

solnoy

    Newbie

  • Members
  • Pip
  • 1 posts

johnpitter said:

I think this code will help you.

Dim elapsed As Long, temptime As Long


Private Sub Command1_Click()

Timer1.Enabled = True

temptime =Hour(now()* 3600+ Minute(Now() * 60 + Second(Now())) + 30 ' this is for 30 seconds. change this to your need

Label1 = temptime

End Sub


Private Sub Timer1_Timer()

 elapsed = Hour(now()*3600 +Minute(Now() * 60 + Second(Now()))


 Label2 = elapsed

Label3 = (temptime - elapsed) & "Seconds"

 If elapsed = temptime Then

 MsgBox ("over")

 Timer1.Enabled = False

 End If

 End Sub

can you please give the full code of this? and also the button,label needed here thank you