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
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''
' 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