|
-
May 2nd, 2001, 04:50 AM
#1
Timer In VB
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
-
May 2nd, 2001, 05:04 AM
#2
Re: Timer In VB
select timer and press F1 man ! dont u know such a simple thing :-)
Regards,
Vinod
-
May 2nd, 2001, 06:26 AM
#3
Re: Timer In VB
'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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|