home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / ch_code / ch14 / alarm / testform.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1997-02-20  |  2.6 KB  |  84 lines

  1. VERSION 5.00
  2. Object = "{F6FEA32D-63C9-11D0-BB11-444553540000}#4.0#0"; "ALARM.ocx"
  3. Begin VB.Form Form1 
  4.    BackColor       =   &H00808080&
  5.    Caption         =   "Alarm Control Demo"
  6.    ClientHeight    =   2265
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   3960
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2265
  12.    ScaleWidth      =   3960
  13.    StartUpPosition =   3  'Windows Default
  14.    Begin ALARM.AlarmCtl AlarmCtl1 
  15.       Height          =   495
  16.       Left            =   1035
  17.       TabIndex        =   2
  18.       Top             =   345
  19.       Width           =   1800
  20.       _ExtentX        =   3175
  21.       _ExtentY        =   873
  22.       CountDown       =   -1  'True
  23.       AlarmTime       =   0.875
  24.    End
  25.    Begin VB.CommandButton AlarmButton 
  26.       Caption         =   "Alarm Time"
  27.       BeginProperty Font 
  28.          Name            =   "MS Sans Serif"
  29.          Size            =   9.75
  30.          Charset         =   0
  31.          Weight          =   400
  32.          Underline       =   0   'False
  33.          Italic          =   0   'False
  34.          Strikethrough   =   0   'False
  35.       EndProperty
  36.       Height          =   450
  37.       Left            =   1020
  38.       TabIndex        =   0
  39.       Top             =   1530
  40.       Width           =   1905
  41.    End
  42.    Begin VB.CommandButton StartButton 
  43.       Caption         =   "Start Timer"
  44.       BeginProperty Font 
  45.          Name            =   "MS Sans Serif"
  46.          Size            =   9.75
  47.          Charset         =   0
  48.          Weight          =   400
  49.          Underline       =   0   'False
  50.          Italic          =   0   'False
  51.          Strikethrough   =   0   'False
  52.       EndProperty
  53.       Height          =   435
  54.       Left            =   1020
  55.       TabIndex        =   1
  56.       ToolTipText     =   "aa"
  57.       Top             =   990
  58.       Width           =   1905
  59.    End
  60. Attribute VB_Name = "Form1"
  61. Attribute VB_GlobalNameSpace = False
  62. Attribute VB_Creatable = False
  63. Attribute VB_PredeclaredId = True
  64. Attribute VB_Exposed = False
  65. Private Sub AlarmCtl1_TimeOut()
  66.     MsgBox "The Alarm has Timed out", , "ALARM CONTROL"
  67. End Sub
  68. Private Sub StartButton_Click()
  69.     If StartButton.Caption = "Start Timer" Then
  70.         AlarmCtl1.StartTimer
  71.         StartButton.Caption = "Stop Timer"
  72.     Else
  73.         StartButton.Caption = "Start Timer"
  74.         AlarmCtl1.StopTimer
  75.     End If
  76. End Sub
  77. Private Sub AlarmButton_Click()
  78.     If AlarmCtl1.CountDown Then
  79.         MsgBox "The alarm is ticking..."
  80.     Else
  81.         MsgBox "The alarm will go off at " & AlarmCtl1.AlarmTime
  82.     End If
  83. End Sub
  84.