I don't mean to bump this thread, but I have a problem that I just can't figure out. I installed the OCX, I added it to my components, and I added the timer control to my form. I'm using VB 6.0.
I tried your code:
Code:
Option Explicit
Dim WithEvents RSTimer1 As RSTimer
Dim WithEvents rstimer2 As RSTimer
Private MSCount As Long, LCount As Long
Private Sub Form_Load()
RSTimer1.Interval = 1 ' 1 millisecond
rstimer2.Interval = 1000 ' 1 Second
RSTimer1.Enabled = True
rstimer2.Enabled = True
End Sub
Private Sub RSTimer1_Timer()
MSCount = MSCount + 1
End Sub
Private Sub RSTimer2_Timer()
Debug.Print Timer, MSCount - LCount
LCount = MSCount
End Sub
I get "Object Variable or with block variable not set".
So then I tried something else:
Code:
Option Explicit
Dim WithEvents Timer As RSTimer
Private Sub Form_Load()
Set Timer = New RSTimer
Timer.Interval = 1
End Sub
Private Sub Form_Terminate()
Set Timer = Nothing
End Sub
Private Sub Timer_Timer(ByVal Seconds As Currency)
label1.Caption = Format$(Seconds, "0.000") & " seconds has passed"
End Sub
And with that, absolutely nothing happens. -_-...