Hi All
I want to use timer in a VB program, but i don't know how I can use it.
Could someone pls help me?
Thanks
Ehsan
Printable View
Hi All
I want to use timer in a VB program, but i don't know how I can use it.
Could someone pls help me?
Thanks
Ehsan
select timer and press F1 man ! dont u know such a simple thing :-)
'Place a timer control, 2 command buttons and
'a textbox on a form, use default names. then
'do something like this
Dim counter as Long
private Sub Form_Load()
Timer1.Enabled = false
Timer1.Interval = 1000 '1 sec
End Sub
private Sub Command1_Click()
If Timer1.Enabled = false then
Timer1.Enabled = true
End If
counter = 0
End Sub
private Sub Command2_Click()
If Timer1.Enabled = true then
Timer1.Enabled = false
End If
End Sub
private Sub Form_Load()
Timer1.Interval = 1000 '1 sec
End Sub
private Sub Timer1_Timer()
counter = counter + 1
Text1.Text = counter
End Sub
Curt