怎么用VB编写个到计时表!!!!

来源:百度知道 编辑:UC知道 时间:2024/06/09 09:29:52
怎么用VB编写个到计时表
程序中要包含有 年 月 日 时 分 秒`

Dim Remain As Integer

Private Sub Command1_Click()
Timer1.Interval = 1000
Timer1.Enabled = True
Remain = (Val(Text1.Text) * 60 + Val(Text2.Text)) * 60 + Val(Text3.Text)
Command1.Enabled = False
End Sub

Private Sub timer1_Timer()
Remain = Remain - 1
If Remain = 0 Then
Timer1.Enabled = False
Command1.Enabled = True
End If
Label1.Caption = Remain
End Sub

static mystate as boolean
mystate=not mystate
if not mystate then exit sub
t=now
do
if now-t then
label1=format(now,"yyyy 年 m 月 d 日 h 时 m 分 s 秒")
end if
sleep 50
doevents
if not mystate then exit sub
loop

最简单的就是你只要是会用这个函数那你就可以根据自己的需要制作出自己满意的工具
diffdate(“可以选择是天还是小时,星期.....什么的”,时间一,时间2)

其中所要求的就是时间一和时间二的相差时间