AR Timer ActiveX Library 2.0

This library will allow you to have a timer in your program without the need of having a form in which place a control. This is more convenient, for example, for classes and Windows NT services.

By the way, you should also check the Common Controls Replacement Project web site. These guys are doing a great job, and they have a library which does the same as this one, but with a few more features. The author of that library is Karl E. Peterson, who also has his own web site.

Objects:

In the library there are two objects, ARTimer and ARCountdown. Use ARTimer to receive an event every certain amount of time. Use ARCountdown if you just want to receive an event after a certain amount of time, and you don't want the timer to keep going.

 

AR TIMER: AR COUNTDOWN:
Properties:
  • Interval. Set this in milliseconds.
  • Running. Read-only; true of the timer is running and false if it is not.

Methods:

  • StartTimer. This starts the timer.
  • StopTimer. This stops the timer.

Events:

  • Timer (TT_H As Long, TT_M As Long, TT_S As Long, TT_MS As Long). This event will be fired every time that the amount of time set in Interval is elapsed. TT_H, TT_M, TT_S and TT_MS will contain the total amount of time elapsed since the timer was started. For convenience, hours, minutes, seconds and milliseconds are given in different variables.
Properties:
  • Interval. Set this in milliseconds.
  • Running. Read-only; true of the counter is running and false if it is not.

Methods:

  • StartCountdown. Starts the countdown.
  • StopCountdown. Stops the countdown.

Events:

  • Done. This event is fired once the time has elapsed. If you want to run the countdown again, use the StartCountdown method.

 

History:

Considerations:

Private Withevents Timer as ARTimer

Then, in the Load event of the form or the Initialize of the class, put this instruction:

Set Timer = New ARTimer

 

(10 Kb)

 

Alvaro Redondo, 1998. All Rights Reserved.
http://www.sevillaonline.com/ActiveX/