vb.net秒跳动 vbs跳转语句( 二 )


End Sub
End Class
用VB编写一个秒表'一个标签,两个按钮,一个计时器 。
'标签显示时间,按钮一控制秒表,按钮二清零 。
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 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
关于vb.net秒跳动和vbs跳转语句的介绍到此就结束了 , 不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息 , 记得收藏关注本站 。

推荐阅读