Wednesday, October 19, 2011

Buat sesama newbe, sekedar berbagi

Tips berikut membuat durasi detik, dengan hitungan mundur misal 10 detik.

Buat Project baru, tambahkan 1 comand button, 1 label, 1 timer
'Di General
Dim skg, waktu, durasi As String


Private Sub Command1_Click()
skg = Val(Timer) + 10
Timer1.Interval = 50
End Sub

Private Sub Timer1_Timer()
waktu = Val(Timer)
durasi = skg - waktu
Label1.Caption = durasi
If durasi = 0 Then Timer1.Interval = 0
End Sub
Categories:

0 comments:

Post a Comment