VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "模拟秒表"
   ClientHeight    =   2295
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4650
   LinkTopic       =   "Form1"
   ScaleHeight     =   2295
   ScaleWidth      =   4650
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Left            =   525
      Top             =   1185
   End
   Begin VB.CommandButton Command3 
      Caption         =   "停止"
      Height          =   315
      Left            =   2025
      TabIndex        =   4
      Top             =   1815
      Width           =   690
   End
   Begin VB.CommandButton Command2 
      Caption         =   "记录"
      Height          =   315
      Left            =   1155
      TabIndex        =   3
      Top             =   1830
      Width           =   690
   End
   Begin VB.ListBox List1 
      Height          =   1680
      Left            =   2910
      TabIndex        =   2
      Top             =   345
      Width           =   1545
   End
   Begin VB.CommandButton Command1 
      Caption         =   "开始"
      Height          =   315
      Left            =   315
      TabIndex        =   1
      Top             =   1815
      Width           =   720
   End
   Begin VB.TextBox Text1 
      Height          =   330
      Left            =   1155
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   840
      Width           =   1455
   End
   Begin VB.Label Label3 
      Caption         =   "模拟秒表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   900
      TabIndex        =   7
      Top             =   120
      Width           =   1500
   End
   Begin VB.Label Label2 
      Caption         =   "记录："
      Height          =   210
      Left            =   2925
      TabIndex        =   6
      Top             =   75
      Width           =   885
   End
   Begin VB.Label Label1 
      Caption         =   "计时："
      Height          =   300
      Left            =   480
      TabIndex        =   5
      Top             =   885
      Width           =   1125
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim H As Integer, M As Integer, S As Integer, mS As Integer
Private Sub Command1_Click()
    Timer1.Interval = 100       '开始计时
    Command1.Enabled = False    '使按钮不可用
    Command2.Enabled = True     '激活按钮
    Command3.Enabled = True
    List1.Clear                 '清空列表框内容
End Sub

Private Sub Command2_Click()
    List1.AddItem Text1.Text    '将文本框内容添加到列表框
End Sub

Private Sub Command3_Click()
    Timer1.Interval = 0         '停止计时
    H = 0: M = 0: S = 0: mS = 0
    Command1.Enabled = True
    Command2.Enabled = False
    Command3.Enabled = False
    Text1.Text = "0:0.0  0"
End Sub

Private Sub Form_Load()
    Command2.Enabled = False
    Command3.Enabled = False
    Text1.Text = ""
End Sub

Private Sub Timer1_Timer()
    '下面程序将计算经过的时间
     If mS < 9 Then
        mS = mS + 1
     Else
        mS = 0
        If S < 59 Then
            S = S + 1
        Else
            S = 0
            If M < 59 Then
                M = M + 1
            Else
                M = 0
                H = H + 1
            End If
        End If
    End If
    '将经过时间的数值转化为字符型显示到文本框
    Text1.Text = Str(H) + ":" + Str(M) + "." + Str(S) + "  " + Str(mS)
End Sub
