注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Mister.Hu(巷里人家)

Go abroad!

 
 
 

日志

 
 
关于我

A campus photograph palyer,an enthusiastic reader,a solitary writer,a future traffic engineer.

网易考拉推荐

VB作业一  

2013-12-13 20:03:03|  分类: Sophomore |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Dim starttime As Variant
Dim endtime As Variant
Dim elapsetime As Variant
Private Sub Command1_Click()
Label4.Caption = ""
Label5.Caption = ""
Label6.Caption = ""
Command1.Enabled = False
Command2.Enabled = True
starttime = Time


Label4.Caption = Label7.Caption
End Sub
Private Sub Command2_Click()
Dim a, b, a1, b1, a2, b2, a3, b3, c, c1, c2, c3
Command1.Enabled = True
Command2.Enabled = False
endtime = Time
Label5 = Label7.Caption
a = Label4.Caption
b = Label5.Caption
a1 = Val(Left(a, 2)) * 3600
a2 = Val(Mid(a, 4, 2)) * 60
a3 = Val(Right(a, 4))
a = a1 + a2 + a3
b1 = Val(Left(b, 2)) * 3600
b2 = Val(Mid(b, 4, 2)) * 60
b3 = Val(Right(b, 4))
b = b1 + b2 + b3
c = b - a
c1 = Int(c / 3600)
c2 = Int((c - c1 * 3600) / 60)
c3 = c - c1 * 3600 - c2 * 60
elapsetime = LTrim(Str(c1)) & ":" & LTrim(Str(c2)) & ":" & Format(c3, "#0.#")
Label6.Caption = elapsetime
End Sub

Private Sub Command3_Click()
Unload Form1
End Sub

Private Sub Form_Load()
Label4.Caption = ""
Label5.Caption = ""
Label6.Caption = ""
Label7.Caption = ""
Command2.Enabled = False
Label9.Caption = Format(Now, "yyyy年mm月dd日")
End Sub

Private Sub Timer1_Timer()
Timer1.Interval = 10
Static j As Variant
Dim k As Variant
Dim l As Integer
If j <= 99 Then k = LTrim(Str(j))
Label7.Caption = Format(Time, "hh:mm:ss.") + k
If j < 99 Then j = j + 1 Else j = 0
End Sub

  评论这张
 
阅读(20)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2016