home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / ALARM / ASAMPLE.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1980-01-04  |  2.9 KB  |  81 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          =   4095
  10.    Icon            =   ASAMPLE.FRX:0000
  11.    Left            =   2190
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   3630
  15.    ScaleWidth      =   3495
  16.    Top             =   1725
  17.    Width           =   3675
  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        =   16.5
  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. Option Explicit
  46. Const AT_Second = 0
  47. Const AT_Hour = 1
  48. Const AT_Minute15 = 2
  49. Const AT_HalfHour = 3
  50. Const AT_Minute45 = 4
  51. Const AT_ColorChange = 10
  52. Sub Alarm1_Alarm (AlarmIndex As Long, TimeNow As String)
  53.     Label1.Caption = TimeNow
  54.     Select Case AlarmIndex
  55.         Case AT_Hour        ' beep three times on the hour
  56.             Beep
  57.             Beep
  58.             Beep
  59.         Case AT_Minute15    ' once on the quarter hour
  60.             Beep
  61.         Case AT_HalfHour    ' twice on the half hour
  62.             Beep
  63.             Beep
  64.         Case AT_Minute45    ' once on the quarter hour
  65.             Beep
  66.         Case AT_ColorChange ' change colors every 10 seconds
  67.                             ' definitely ugly (random color)
  68.             Label1.ForeColor = Rnd * &H1000000
  69.     End Select
  70. End Sub
  71. Sub Form_Load ()
  72.     ASample.Left = (Screen.Width - ASample.Width) / 2
  73.     ASample.Top = (Screen.Height - ASample.Height) / 2
  74.     Alarm1.AlarmTime(AT_Second) = "??:??:??"
  75.     Alarm1.AlarmTime(AT_Hour) = "??:00:00"
  76.     Alarm1.AlarmTime(AT_Minute15) = "??:15:00"
  77.     Alarm1.AlarmTime(AT_HalfHour) = "??:30:00"
  78.     Alarm1.AlarmTime(AT_Minute45) = "??:45:00"
  79.     Alarm1.AlarmTime(AT_ColorChange) = "??:??:?0"
  80. End Sub
  81.