'Persiapan: 1. Buat 1 Project baru dengan 1 Form.
' 2. Tambahkan 1 control Timer dan 2 Label.
' 3. Copy-kan coding berikut ke dalam editor form yang bertalian.
'--------------------------------------------------------------------------
Dim StatusLanjut As Boolean
Private Sub Form_KeyPress(KeyAscii As Integer)
If StatusLanjut = False Then
Timer1.Enabled = True
StatusLanjut = True
Label1.Caption = "Press any key to stop..."
ElseIf StatusLanjut = True Then
Timer1.Enabled = False
StatusLanjut = False
Label1.Caption = "Press any key to continue.."
End If
End Sub
Private Sub Form_Load()
Label1.Caption = "Press any key to continue..."
Label2.Caption = Time
Timer1.Interval = 500
Timer1.Enabled = False
StatusLanjut = False
End Sub
Private Sub Timer1_Timer()
Label2.Caption = Time
End Sub
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar