ActiveX: SLAlarm
(Filename: SLALARM.OCX)

SLAlarm is an ActiveX component that lets you set multiple alarms,
that goes off at various times and dates. This general alarm control makes
it easy to schedule events.
Properties
|
Name |
Type |
Description |
|
Activated |
Boolean |
Activates or deactivates
the alarm control. If this property has the value False no
alarm events will be fired. If this property has the value True
alarm events will be fired if there is a match between the current
date and time and the scheduled date and time.
|
|
IgnoreDate |
Boolean |
If this property has
the value True, only the time of an added alarm will be used
- the date part will be ignored. If this property has the value
False both date and time must match before an alarm event
will be fired.
|
Events
|
Name |
Description |
|
Alarm |
This event occurs when
the alarm date and time is the same as current date and time. The
ID parameter contains the alarm identifier
of the fired alarm.
|
Methods
Add (DateTime As Date, ID As Integer)
As Boolean
Adds time and date to the internal list of scheduled
alarms. The date/time is specified by the
DateTime parameter. The ID parameter
can be used to set a unique identifier for an alarm and can be used
in the Alarm event to identify the
alarm.Clear
()
Removes all added date and times from the alarm control.
|
Example
The example below add two alarm times to the
SLAlarm
control. Both date and time
must be correct before an alarm event can be fired. When the condition is
true, the alarm is fired via the Alarm event.
Dim DT As Date
DT = "2009-07-28
17:00"
' Time 1
SLAlarm1.Add DT,
1
DT = "2009-07-28 19:00"
' Time 2
SLAlarm1.Add DT,
2
SLAlarm1.IgnoreDate = False
Private Sub SLAlarm1_Alarm(ByVal
ID As Integer)
MsgBox "Alarm number: " + CStr(ID), 0, "Alarm"
End Sub
< Go back
|
|