挺粗糙的,共勉吧
Option Explicit
Dim I As Double
Dim k As Integer
Private Sub Form_Load()
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
I = I + 1
Text1.Text = I / 100 '计时器INTERVAL取的是10,0.01秒精度
End Sub
Private Sub Command1_Click() '开始计时
I = 0
Timer1.Enabled = True
End Sub
Private Sub Command2_Click() '取时
k = k + 1
List1.AddItem "第" & k & "名成绩是:" & Text1.Text & "秒"
End Sub
Private Sub Command3_Click() '结束比赛
Timer1.Enabled = False
List1.AddItem "最后一名成绩是:" & Text1.Text & "秒"
End Sub
Private Sub Command4_Click()
End
End Sub
下面是设计源程序
[此贴子已经被作者于2007-6-7 12:33:24编辑过]
Option Explicit
Dim lsStart
Dim lbOver As Boolean
Private Sub Command1_Click()
lbOver = False
Timer1.Enabled = True
lsStart = Time
End Sub
Private Sub Command2_Click()
If lbOver = True Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Command3_Click()
Timer1.Enabled = True
lbOver = True
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
lbOver = True
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim llMin As Long
Dim llHour As Long
Dim llSec As Long
Dim llCount As Long
llCount = DateDiff("s", lsStart, Time)
If lbOver = False Then
llHour = llCount \ 3600
llMin = (llCount Mod 3600) \ 60
llSec = llCount Mod 60
Label1 = Format(llHour, "00") & ":" & Format(llMin, "00") & ":" & Format(llSec, "00") & Timer - Int(Timer)
Else
Label1 = Now
End If
End Sub
这样是不是你要的结果
[此贴子已经被作者于2007-6-7 15:47:39编辑过]