Software Development Network>> VS Express Editions>> How to use the timer correctly?
Leshay,
My whole point is that you don't need to drag a timer on. And I'm glad you got it!
It's pretty simple. I'd declare your timer as a member variable.
Protected Friend WithEvents WBTimer as As New System.Windows.Forms.Timer
Then when you want to initialize it, remember that its time unit is milliseconds. For a one minute interval:
Wbtimer.Interval = 60*1000
Wbtimer.enable= true
WBtimer.start()
But you aren't finished yet.......
You need an event handler which is the business end of the timer:
Private
' Do your stuff here
End Sub
Enjoy !
Thanks, got my Timer working with your assistance.
Once I discovered that I needed a Timer object draged onto my form it was easy
How to use the timer correctly?
Wessam Bahnassi
Fabian
BrianNoyes
Leshay,
My whole point is that you don't need to drag a timer on. And I'm glad you got it!
unborracho
It's pretty simple. I'd declare your timer as a member variable.
Protected Friend WithEvents WBTimer as As New System.Windows.Forms.Timer
Then when you want to initialize it, remember that its time unit is milliseconds. For a one minute interval:
Wbtimer.Interval = 60*1000
Wbtimer.enable= true
WBtimer.start()
But you aren't finished yet.......
You need an event handler which is the business end of the timer:
Private
Sub WBTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles WBTimer.Tick' Do your stuff here
End Sub
Enjoy !
Etheren
Thanks, got my Timer working with your assistance.
Once I discovered that I needed a Timer object draged onto my form it was easy