VB设计一个秒表模拟程序
1.设计一个秒表模拟程序,按下“开始”按钮,屏幕显示当前时间;按下“结束”按钮,屏幕显示结束时间和持续时间;按下“退出”,结束程序DimaAsDateDimbAsDate...
1.设计一个秒表模拟程序,按下“开始”按钮,屏幕显示当前时间;按下“结束”按钮,屏幕显示结束时间和持续时间;按下“退出”,结束程序
Dim a As Date
Dim b As Date
Private Sub Command1_Click()
a = Time
Text1.Text = a
End Sub
Private Sub Command2_Click()
b = Time
Text2.Text = b
Text3.Text = Format(DateDiff("s", a, b), "00:00:00")
End Sub
Private Sub Command3_Click()
End
End Sub
已经实现了秒表的功能 不过 只能计时到00:00:99才能变成00:01:00跪求高手指导让他变成当秒表到00:00:59然后进位成00:01:00 谢谢 感激不尽 展开
Dim a As Date
Dim b As Date
Private Sub Command1_Click()
a = Time
Text1.Text = a
End Sub
Private Sub Command2_Click()
b = Time
Text2.Text = b
Text3.Text = Format(DateDiff("s", a, b), "00:00:00")
End Sub
Private Sub Command3_Click()
End
End Sub
已经实现了秒表的功能 不过 只能计时到00:00:99才能变成00:01:00跪求高手指导让他变成当秒表到00:00:59然后进位成00:01:00 谢谢 感激不尽 展开
3个回答
展开全部
Text3.Text = Format(DateDiff("s", a, b), "00:00:00")
改成如下:
Text3.Text = Format(b - a, "hh:mm:ss")
改成如下:
Text3.Text = Format(b - a, "hh:mm:ss")
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim a As Date
Dim b As Date
Private Sub Command1_Click()
a = Time
Text1.Text = a
End Sub
Private Sub Command2_Click()
b = Time
Text2.Text = b
Text3.Text = Format(DateDiff("s", a, b), "00:00:00")
End Sub
Private Sub Command3_Click()
End
End Sub
Dim b As Date
Private Sub Command1_Click()
a = Time
Text1.Text = a
End Sub
Private Sub Command2_Click()
b = Time
Text2.Text = b
Text3.Text = Format(DateDiff("s", a, b), "00:00:00")
End Sub
Private Sub Command3_Click()
End
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command2_Click()
b = Time
Text2.Text = b
tt = DateDiff("s", a, b)
TmpH = tt \ 3600
TmpM = (tt Mod 3600) \ 60
TmpS = tt Mod 60
Text3.Text = Format(TmpH & ":" & TmpM & ":" & TmpS, "HH:MM:SS")
End Sub
b = Time
Text2.Text = b
tt = DateDiff("s", a, b)
TmpH = tt \ 3600
TmpM = (tt Mod 3600) \ 60
TmpS = tt Mod 60
Text3.Text = Format(TmpH & ":" & TmpM & ":" & TmpS, "HH:MM:SS")
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询