Forma 4 label,1 buton ve 1 timer yerleştirin.Aşağıdaki kodları kod sayfasına yapıştırın.Sonuçta butonu tıklayınca kronometre çalışsın.
Dim a As Integer, b As Integer, c As Integer, d As Integer
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Label1.Caption = "00"
Timer1.Enabled = False
Label2.Caption = "00"
Label3.Caption = "00"
Label4.Caption = "00"
Command1.Caption = "başla"
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
a = a + 1
Label1.Caption = a
If a = 99 Then
b = b + 1
If b < 10 Then
Label2.Caption = "0" & b
Else
Label2.Caption = b
End If
a = 0
End If
If b = 60 Then
b = 0
c = c + 1
Label3.Caption = c
End If
If c = 60 Then
c = 0
d = d + 1
Label4.Caption = d
End If
End Sub