Click to See Complete Forum and Search --> : Timer as object


jen
October 6th, 1999, 01:29 AM
Hi!
I would like to have a timer as an object. But I guess that since it is an activeX control I canīt create it??

This is what I had in mind:
Dim tim As Timer
Set tim = CreateObject("VB.Timer")

My project is a activeXdll. I want a timer to run somehow. How can I achive that?

Jen

Lothar Haensler
October 6th, 1999, 01:45 AM
this a sample for using a Timer:

Dim x as Variant
x = Timer
MsgBox x
Dim y as Variant
y = Timer
MsgBox y - x



it is used for calculating the elapsed time between two code sections.

I gues what YOU need is a timer control.
You can place such an object on a (hidden) form and trap the "Timer" event.

You could also use the SetTimer API call.

suntosh
October 6th, 1999, 02:08 AM
try this out !!

add a form Form1 to the project (although you dont need to show it)
add a timer control to the form

then you can create :
dim t as new form1.timer1