Desain form seperti di bawah ini :
Kemudian script di bawah ini sesuai dengan procedurenya :
'di command Mulai/selesai
Private Sub Command1_Click()
If Command1.Caption = "Mulai" Then
Label4.Caption = Format(Time(), "hh:mm:ss")
Command1.Caption = "Selesai"
Command2.Enabled = False
ElseIf Command1.Caption = "Selesai" Then
Label5.Caption = Format(Time(), "hh:mm:ss")
Command1.Caption = "Mulai"
Label6.Caption = Format((CDate(Label5.Caption) - CDate(Label4.Caption)), "hh:mm:ss")
Command1.Enabled = False
Command2.Enabled = True
End If
End Sub
'di command reset
Private Sub Command2_Click()
Label4.Caption = "00:00:00"
Label5.Caption = "00:00:00"
Label6.Caption = "00:00:00"
Command1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Form1.Caption = "Sekarang Jam : " & FormatDateTime(Time(), vbLongTime)
End Sub
interval timernya di setting berapa ya?
BalasHapusSIP
BalasHapus100 gan
BalasHapus