home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "*\AAlarm.vbp"
- Begin VB.Form TestForm
- BackColor = &H00C0C0C0&
- Caption = "Alarm Control Demo"
- ClientHeight = 3375
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 8535
- LinkTopic = "Form1"
- ScaleHeight = 3375
- ScaleWidth = 8535
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command1
- Caption = "E X I T"
- BeginProperty Font
- Name = "Verdana"
- Size = 11.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 6720
- TabIndex = 12
- Top = 2760
- Width = 1695
- End
- Begin VB.Frame Frame2
- Height = 2535
- Left = 4440
- TabIndex = 6
- Top = 0
- Width = 3975
- Begin VB.CheckBox Check2
- BackColor = &H00C0C0C0&
- Caption = "CountDown"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000080&
- Height = 255
- Left = 2160
- TabIndex = 10
- Top = 960
- Value = 1 'Checked
- Width = 1575
- End
- Begin VB.CommandButton StartButton2
- Caption = "Start Timer"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 435
- Left = 240
- TabIndex = 8
- ToolTipText = "aa"
- Top = 1350
- Width = 1800
- End
- Begin VB.CommandButton AlarmButton2
- Caption = "Alarm Time"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 450
- Left = 240
- TabIndex = 7
- Top = 1890
- Width = 1800
- End
- Begin AlarmProject.AlarmCtl AlarmCtl2
- Height = 495
- Left = 240
- TabIndex = 9
- Tag = "Process B"
- Top = 720
- Width = 1800
- _ExtentX = 3175
- _ExtentY = 873
- CountDown = -1 'True
- AlarmTime = 0.790277777777778
- End
- Begin VB.Label Label2
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- Caption = "Process B"
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 14.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FF0000&
- Height = 375
- Left = 240
- TabIndex = 11
- Top = 240
- Width = 1800
- End
- End
- Begin VB.Frame Frame1
- BackColor = &H00C0C0C0&
- Height = 2535
- Left = 120
- TabIndex = 0
- Top = 0
- Width = 3975
- Begin VB.CheckBox Check1
- BackColor = &H00C0C0C0&
- Caption = "CountDown"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000080&
- Height = 255
- Left = 2220
- TabIndex = 4
- Top = 960
- Width = 1695
- End
- Begin VB.CommandButton StartButton1
- Caption = "Start Timer"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 435
- Left = 240
- TabIndex = 3
- ToolTipText = "aa"
- Top = 1350
- Width = 1800
- End
- Begin VB.CommandButton AlarmButton1
- Caption = "Alarm Time"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 450
- Left = 240
- TabIndex = 2
- Top = 1890
- Width = 1800
- End
- Begin AlarmProject.AlarmCtl AlarmCtl1
- Height = 495
- Left = 240
- TabIndex = 1
- Tag = "Process A"
- Top = 720
- Width = 1800
- _ExtentX = 3175
- _ExtentY = 873
- AlarmTime = 0.790277777777778
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- Caption = "Process A"
- BeginProperty Font
- Name = "Comic Sans MS"
- Size = 14.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00FF0000&
- Height = 375
- Left = 240
- TabIndex = 5
- Top = 240
- Width = 1800
- End
- End
- Attribute VB_Name = "TestForm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' ******************************
- ' ******************************
- ' ** MASTERING VB6 **
- ' ** by Evangelos Petroutos **
- ' ** SYBEX, 1998 **
- ' ******************************
- ' ******************************
- Private Sub AlarmCtl1_TimeOut()
- MsgBox "The Alarm " & AlarmCtl1.Tag & " has Timed out", , "ALARM CONTROL"
- End Sub
- Private Sub AlarmCtl2_TimeOut()
- MsgBox "The Alarm " & AlarmCtl2.Tag & " has Timed out", , "ALARM CONTROL"
- End Sub
- Private Sub Check1_Click()
- If Check1.Value Then
- AlarmCtl1.CountDown = True
- Else
- AlarmCtl1.CountDown = False
- End If
- End Sub
- Private Sub Check2_Click()
- If Check2.Value Then
- AlarmCtl2.CountDown = True
- Else
- AlarmCtl2.CountDown = False
- End If
- End Sub
- Private Sub Command1_Click()
- End
- End Sub
- Private Sub Form_Load()
- Randomize Time
- AlarmCtl1.AlarmTime = Rnd()
- AlarmCtl2.AlarmTime = Rnd()
- End Sub
- Private Sub StartButton1_Click()
- If StartButton1.Caption = "Start Timer" Then
- AlarmCtl1.StartTimer
- StartButton1.Caption = "Stop Timer"
- Else
- StartButton1.Caption = "Start Timer"
- AlarmCtl1.StopTimer
- End If
- End Sub
- Private Sub AlarmButton1_Click()
- MsgBox "The alarm will go off at " & AlarmCtl1.AlarmTime
- End Sub
- Private Sub StartButton2_Click()
- If StartButton2.Caption = "Start Timer" Then
- AlarmCtl2.StartTimer
- StartButton2.Caption = "Stop Timer"
- Else
- StartButton2.Caption = "Start Timer"
- AlarmCtl2.StopTimer
- End If
- End Sub
- Private Sub AlarmButton2_Click()
- MsgBox "The alarm will go off at " & AlarmCtl2.AlarmTime
- End Sub
-