NAMA : SURANA. (MI)
TUGAS VISUAL BASIS PROGRAM TARIF TELEPHONE FLAT (LISTEN)
Dim AWAL, AKHIR, LAMA As Variant
Private Sub Command1_Click()
If Command1.Caption = "START" Then
AWAL = Now
Text1.Text = Format(AWAL, "HH:MM:SS")
Command1.Caption = "STOP"
ElseIf Command1.Caption = "STOP" Then
AKHIR = Now
LAMA = AWAL - AKHIR
Text2.Text = Format(AKHIR, "HH:MM:SS")
LAMA = (Hour(LAMA) * 3600) + (Minute(LAMA) * 60) + (Second(LAMA))
Text3.Text = LAMA & " DETIK "
Text4.Text = LAMA * 10
Text4.Text = " Rp " & Text4
Command1.Caption = "START"
ElseIf Command1.Caption = "START" Then
End If
End Sub
Private Sub Command2_Click()
Command2.Caption = "SELESAI"
Unload Me
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Timer1_Timer()
If Command1.Caption = "STOP" Then
Text2.Text = Format(Now, "HH:MM:SS")
Text3.Text = Format(Now - MULAI, "HH:MM:SS")
End If
End Sub
Selamat Mencoba.