Dim MiliSec As Integer
Dim Menit As Integer
Dim Secon As Integer
Private Sub Command1_Click()
If (Command1.Caption = "Stop") Then
Command1.Caption = "Start"
Timer1.Enabled = False
Else
If (Command1.Caption = "Start") Then
Command1.Caption = "Stop"
Timer1.Enabled = True
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
LblTime.Caption = "00" + ":" + "00" + ":" + "00"
MiliSec = 0
Secon = 0
Menit = 0
End Sub
Private Sub Form_Load()
LblTime.Caption = "00" + ":" + "00" + ":" + "00"
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
MiliSec = MiliSec + 1
If MiliSec > 59 Then
Secon = Secon + 1
MiliSec = 0
If Secon > 59 Then
Menit = Menit + 1
Secon = 0
End If
End If
LblTime.Caption = Format$(Menit, "00") + ":" + Format$(Secon, "00") + ":" + Format$(MiliSec, "00")
End Sub
0 komentar:
Posting Komentar