We help IT Professionals succeed at work.

timer in activex dll

d_glenn
d_glenn asked
on
How do I put a timer into a VB activex dll?  In a normal exe program I would put the timer control on the form.  But there is no form to put the timer on.

Thanks
DG
Comment
Watch Question

Éric MoreauSenior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016

Commented:
You can create a dummy form (one that will never be displayed to the user) or use the free timer control from the CCRP at http://www.mvps.org/ccrp/controls/ccrptimer6.htm

Author

Commented:
I apologize for my ignorance, but how do I then use the timer from my class?

Thanks, your help is greatly appreciated.
DG
Commented:
Add a standard form to your ActiveX Dll project. Set the form's Visible property to false. Add a timer to the form. Add your code to handle the Timer event on the form. You can set any of the timer's properties (Enabled, Interval) from the ActiveX class through the form (Form1.Timer1.Interval = 1000).
Éric MoreauSenior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016

Commented:
Download the sample that comes with it. You will see object variables declarations.

Author

Commented:
Thanks, that is exactly what I needed!