home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / various / alarm / asample.frm < prev    next >
Text File  |  1995-02-27  |  3KB  |  90 lines

  1. VERSION 2.00
  2. Begin Form ASample 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Alarm Sample"
  5.    ClientHeight    =   3630
  6.    ClientLeft      =   2280
  7.    ClientTop       =   2100
  8.    ClientWidth     =   3495
  9.    Height          =   4155
  10.    Icon            =   ASAMPLE.FRX:0000
  11.    Left            =   2220
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   3630
  15.    ScaleWidth      =   3495
  16.    Top             =   1635
  17.    Width           =   3615
  18.    Begin MabryAlarm Alarm1 
  19.       DateFormat      =   ""
  20.       Left            =   120
  21.       Top             =   120
  22.    End
  23.    Begin Label Label2 
  24.       Caption         =   "This is a very simple demonstration of the Alarm custom control.  This program uses the control to update the clock every second with the current time.  It also uses the control to notify the program every 10 seconds (the clock color is changed randomly every 10 seconds).  Lastly, the program uses Alarm to beep every 15 minutes (on the hour, half hour, and quarter hours)."
  25.       Height          =   2415
  26.       Left            =   240
  27.       TabIndex        =   1
  28.       Top             =   960
  29.       Width           =   3015
  30.    End
  31.    Begin Label Label1 
  32.       Alignment       =   2  'Center
  33.       FontBold        =   -1  'True
  34.       FontItalic      =   0   'False
  35.       FontName        =   "MS Sans Serif"
  36.       FontSize        =   17.25
  37.       FontStrikethru  =   0   'False
  38.       FontUnderline   =   0   'False
  39.       Height          =   495
  40.       Left            =   240
  41.       TabIndex        =   0
  42.       Top             =   240
  43.       Width           =   3015
  44.    End
  45. End
  46. Option Explicit
  47.  
  48. Const AT_Second = 0
  49. Const AT_Hour = 1
  50. Const AT_Minute15 = 2
  51. Const AT_HalfHour = 3
  52. Const AT_Minute45 = 4
  53. Const AT_ColorChange = 10
  54.  
  55. Sub Alarm1_Alarm (AlarmIndex As Long, TimeNow As String)
  56.     Label1.Caption = TimeNow
  57.  
  58.     Select Case AlarmIndex
  59.         Case AT_Hour        ' beep three times on the hour
  60.             Beep
  61.             Beep
  62.             Beep
  63.         Case AT_Minute15    ' once on the quarter hour
  64.             Beep
  65.         Case AT_HalfHour    ' twice on the half hour
  66.             Beep
  67.             Beep
  68.         Case AT_Minute45    ' once on the quarter hour
  69.             Beep
  70.  
  71.         Case AT_ColorChange ' change colors every 10 seconds
  72.                             ' definitely ugly (random color)
  73.             Label1.ForeColor = Rnd * &H1000000
  74.     End Select
  75. End Sub
  76.  
  77. Sub Form_Load ()
  78.     ASample.Left = (Screen.Width - ASample.Width) / 2
  79.     ASample.Top = (Screen.Height - ASample.Height) / 2
  80.  
  81.     Alarm1.AlarmTime(AT_Second) = "??:??:??"
  82.     Alarm1.AlarmTime(AT_Hour) = "??:00:00"
  83.     Alarm1.AlarmTime(AT_Minute15) = "??:15:00"
  84.     Alarm1.AlarmTime(AT_HalfHour) = "??:30:00"
  85.     Alarm1.AlarmTime(AT_Minute45) = "??:45:00"
  86.  
  87.     Alarm1.AlarmTime(AT_ColorChange) = "??:??:?0"
  88. End Sub
  89.  
  90.