|
-
Nov 12th, 2003, 09:51 AM
#1
Thread Starter
Registered User
timer
how do i create a timer within a class during runtime when the user clicks a button? I want the tick sub to be in the class if possible? so basically, can you add a timer to something other than a form?
-
Nov 12th, 2003, 09:57 AM
#2
I wonder how many charact
Yes.
VB Code:
Dim x As New Timer
AddHandler x.Tick, AddressOf mytickhandlingsub
Private Sub mytickhandlingsub(ByVal sender As Object, ByVal e As System.EventArgs)
'do your stuff here
End Sub
-
Nov 12th, 2003, 06:42 PM
#3
Thread Starter
Registered User
thanks. that works. is there a way to pass arguments to the tick function though? thanks again.
-
Nov 12th, 2003, 07:08 PM
#4
Tick is not a function its an event and so you can't really pass arguments to it. It gets raised by the timer object itself so only the timer itself passes any arguments to it.
-
Nov 12th, 2003, 08:46 PM
#5
Thread Starter
Registered User
yeah. i figured that, but thanks for clarifying.
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
|