PDA

View Full Version : Countdown Timer [VB6]


eRage
11-11-2008, 03:25 PM
Source Code:

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''
' Countdown timer by enraged // erage '
' make sure you set the timers interval to 1000 (1 second)'
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''

Private Sub Command1_Click()
Label1.Caption = Text1.Text
' Sets the text "time" to the number in the text bo
End Sub

Private Sub Command2_Click()
Timer1.Enabled = True
' enables timer, starting the mechanism
End Sub

Private Sub Command3_Click()
Timer1.Enabled = False
' disabled the timer, stopping the mechanism
End Sub

Private Sub Command4_Click()
Label1.Caption = Text1.Text
' sets the label "time" to the text in the textbox
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
' makes sure the timer is disabled at form load
End Sub

Private Sub Timer1_Timer()
Label1.Caption = Label1.Caption - 1
' This takes away "1" from label1.caption
If Label1.Caption = 0 Then
' asks if label1.caption is 0
Timer1.Enabled = False
' if label1.caption is 0, timer1 is disabled to prevent the timer
' counting into negative numbers
MsgBox ("Finished")
' displays a message box when the timer hits 0
End If
' ends the if
End Sub


GUI
http://www.tehupload.com/uploads/app-62461443467858662.png

Mko
11-11-2008, 03:28 PM
Nice timer Erage!
Maybe add a little more color.
That would make it way better.
Overall, I would give it a 8/10, nice job!

eRage
11-11-2008, 03:39 PM
Nice timer Erage!
Maybe add a little more color.
That would make it way better.
Overall, I would give it a 8/10, nice job!

..It's not a release.. it's a tutorial. It doesn't need color seeing as its not being downloaded, or used by anyone. Also, it's not like i'm spoilt for choice on the vb6 gui

Zaga
11-11-2008, 10:39 PM
this is basically how boss timers are built

not much more to it except setting what it counts down from automatically

bandit jon
11-13-2008, 11:15 AM
nice can i use this for my computer class?:)

jordanmckeag
11-15-2008, 12:13 PM
Everyone join IM RETARDED.

I am no one
11-17-2008, 06:23 PM
you is for srs smartness