home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / alarm.exe / ASAMPLE.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-08-15  |  3.5 KB  |  110 lines

  1. VERSION 4.00
  2. Begin VB.Form ASample 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    Caption         =   "Alarm Sample"
  7.    ClientHeight    =   3630
  8.    ClientLeft      =   2280
  9.    ClientTop       =   2100
  10.    ClientWidth     =   3495
  11.    BeginProperty Font 
  12.       name            =   "MS Sans Serif"
  13.       charset         =   1
  14.       weight          =   700
  15.       size            =   8.25
  16.       underline       =   0   'False
  17.       italic          =   0   'False
  18.       strikethrough   =   0   'False
  19.    EndProperty
  20.    ForeColor       =   &H80000008&
  21.    Height          =   4035
  22.    Icon            =   "ASAMPLE.frx":0000
  23.    Left            =   2220
  24.    LinkTopic       =   "Form1"
  25.    MaxButton       =   0   'False
  26.    ScaleHeight     =   3630
  27.    ScaleWidth      =   3495
  28.    Top             =   1755
  29.    Width           =   3615
  30.    Begin AlarmLib.Alarm Alarm1 
  31.       Left            =   0
  32.       Top             =   0
  33.       _version        =   65541
  34.       _extentx        =   847
  35.       _extenty        =   847
  36.       _stockprops     =   64
  37.       dateformat      =   ""
  38.    End
  39.    Begin VB.Label Label2 
  40.       Appearance      =   0  'Flat
  41.       BackColor       =   &H80000005&
  42.       Caption         =   $"ASAMPLE.frx":030A
  43.       ForeColor       =   &H80000008&
  44.       Height          =   2415
  45.       Left            =   240
  46.       TabIndex        =   1
  47.       Top             =   960
  48.       Width           =   3015
  49.    End
  50.    Begin VB.Label Label1 
  51.       Alignment       =   2  'Center
  52.       Appearance      =   0  'Flat
  53.       BackColor       =   &H80000005&
  54.       BeginProperty Font 
  55.          name            =   "MS Sans Serif"
  56.          charset         =   1
  57.          weight          =   700
  58.          size            =   16.5
  59.          underline       =   0   'False
  60.          italic          =   0   'False
  61.          strikethrough   =   0   'False
  62.       EndProperty
  63.       ForeColor       =   &H80000008&
  64.       Height          =   495
  65.       Left            =   240
  66.       TabIndex        =   0
  67.       Top             =   240
  68.       Width           =   3015
  69.    End
  70. Attribute VB_Name = "ASample"
  71. Attribute VB_Creatable = False
  72. Attribute VB_Exposed = False
  73. Option Explicit
  74. Const AT_Second = 0
  75. Const AT_Hour = 1
  76. Const AT_Minute15 = 2
  77. Const AT_HalfHour = 3
  78. Const AT_Minute45 = 4
  79. Const AT_ColorChange = 10
  80. Private Sub Alarm1_Alarm(AlarmIndex As Long, TimeNow As String)
  81.     Label1.Caption = TimeNow
  82.     Select Case AlarmIndex
  83.         Case AT_Hour        ' beep three times on the hour
  84.             Beep
  85.             Beep
  86.             Beep
  87.         Case AT_Minute15    ' once on the quarter hour
  88.             Beep
  89.         Case AT_HalfHour    ' twice on the half hour
  90.             Beep
  91.             Beep
  92.         Case AT_Minute45    ' once on the quarter hour
  93.             Beep
  94.         Case AT_ColorChange ' change colors every 10 seconds
  95.                             ' definitely ugly (random color)
  96.             Label1.ForeColor = Rnd * &H1000000
  97.     End Select
  98. End Sub
  99. Private Sub Form_Load()
  100.     Randomize
  101.     ASample.Left = (Screen.Width - ASample.Width) / 2
  102.     ASample.Top = (Screen.Height - ASample.Height) / 2
  103.     Alarm1.AlarmTime(AT_Second) = "??:??:??"
  104.     Alarm1.AlarmTime(AT_Hour) = "??:00:00"
  105.     Alarm1.AlarmTime(AT_Minute15) = "??:15:00"
  106.     Alarm1.AlarmTime(AT_HalfHour) = "??:30:00"
  107.     Alarm1.AlarmTime(AT_Minute45) = "??:45:00"
  108.     Alarm1.AlarmTime(AT_ColorChange) = "??:??:?0"
  109. End Sub
  110.