我用vb6.0做了一个秒表,可很慢,求大侠改改 20
DimmAsInteger,sAsInteger,msAsInteger,flagAsBooleanPrivateSubCommand1_Click()Ifflag=Fa...
Dim m As Integer, s As Integer, ms As Integer, flag As Boolean
Private Sub Command1_Click()
If flag = False Then
Timer1.Interval = 10
flag = True
Else
Timer1.Interval = 0
flag = False
End If
End Sub
Private Sub Command2_Click()
flag = False
Timer1.Interval = 0
m = 0
s = 0
ms = 0
Label1.Caption = "00:00:00"
End Sub
Private Sub Command3_Click()
Form2.Visible = True
Form3.Visible = False
End Sub
Private Sub Timer1_Timer()
ms = ms + 1
If ms = 100 Then
s = s + 1
ms = 0
End If
If s = 60 Then
m = m + 1
s = 0
End If
Label1.Caption = Format(m, "00:") & Format(s, "00:") & Format(ms, "00")
End Sub 展开
Private Sub Command1_Click()
If flag = False Then
Timer1.Interval = 10
flag = True
Else
Timer1.Interval = 0
flag = False
End If
End Sub
Private Sub Command2_Click()
flag = False
Timer1.Interval = 0
m = 0
s = 0
ms = 0
Label1.Caption = "00:00:00"
End Sub
Private Sub Command3_Click()
Form2.Visible = True
Form3.Visible = False
End Sub
Private Sub Timer1_Timer()
ms = ms + 1
If ms = 100 Then
s = s + 1
ms = 0
End If
If s = 60 Then
m = m + 1
s = 0
End If
Label1.Caption = Format(m, "00:") & Format(s, "00:") & Format(ms, "00")
End Sub 展开
展开全部
If flag = False Then
Timer1.Interval = 10 改为100
flag = True
ms = ms + 1
If ms = 100 Then 改为10
s = s + 1
会好点
Timer1.Interval = 10 改为100
flag = True
ms = ms + 1
If ms = 100 Then 改为10
s = s + 1
会好点
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询