VERSION 5.00
Begin VB.Form frmTimer 
   Caption         =   "Programm Timer"
   ClientHeight    =   3375
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5100
   LinkTopic       =   "Form1"
   ScaleHeight     =   3375
   ScaleWidth      =   5100
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer Timer1 
      Interval        =   500
      Left            =   0
      Top             =   0
   End
   Begin VB.CommandButton CmdEnableDisable 
      Caption         =   "Включить"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1560
      TabIndex        =   1
      Top             =   1800
      Width           =   1695
   End
   Begin VB.CommandButton CmDExit 
      Caption         =   "Exit"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1560
      TabIndex        =   0
      Top             =   2520
      Width           =   1695
   End
   Begin VB.Label Label1 
      Caption         =   " "
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   0
      TabIndex        =   2
      Top             =   120
      Width           =   5055
   End
End
Attribute VB_Name = "frmTimer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Все переменные необходимо объявлять заранее
Option Explicit
'объявляем переменную gkeepTrack
Dim gflag
Dim lngA As Long

Private Sub CmdEnableDisable_Click()

If gflag = 1 Then
gflag = 0
CmdEnableDisable.Caption = "Включить"

Else
gflag = 1

CmdEnableDisable.Caption = "Выключить"
End If
End Sub

Private Sub CmDExit_Click()
End
End Sub

Private Sub tmrTimer_Timer()
'пищать разрешено, только если переменная
'gflag = 1

If gflag = 1 Then
Beep
End If
End Sub

Private Sub Timer1_Timer()
If gflag = 1 Then

Label1.Caption = "Текущее время " + Str(Time) + " секунд"  '-
Else

Label1.Caption = ""

End If

End Sub
