VB6.0 倒计时的小程序

请帮忙写个倒计时的小程序要求附有生成exe文件后的截图源代码要有解释程序能够提供备忘记事就是闹铃的时候能够弹出一个文本谢谢高手了... 请帮忙写个倒计时的小程序 要求附有生成exe文件后的截图 源代码要有解释
程序能够提供备忘记事 就是闹铃的时候能够弹出一个文本
谢谢高手了
展开
 我来答
匿名用户
推荐于2020-12-14
展开全部
Dim ydsj As Date

Private Sub Form_Load()
ydsj = InputBox("请输入约定时间!格式如括号里:(年号/月号/日子)或者又如括号里:(年号/月号/日子空格小时:分钟:秒数)如下格式:", , "2011/1/1 00:00:00")
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Dim dqnyr As Date
If Now < ydsj Then

sysj = ydsj - Now

syn = Year(ydsj) - Year(Now) - 1

If Year(ydsj) = Year(Now) Then syn = syn + 1 '年

syy = 12 - Month(Now) & "+" & Month(ydsj) - 1 & "=" & 12 - Month(Now) + Month(ydsj) - 1

If Year(ydsj) = Year(Now) Then

syy = Month(ydsj) - Month(Now) - 1

If Month(ydsj) = Month(Now) Then syy = syy + 1

End If

'月

dqnf = Year(Now)

dqyf = Month(Now)

If dqyf = 12 Then

dqyf = 1

dqnf = dqnf + 1

End If

dqnyr = dqnf & "-" & dqyf & "- " & 1

syr = Fix(dqnyr - Now) & "+" & Day(ydsj) - 1 & "=" & Fix(dqnyr - Now) + Day(ydsj) - 1

If Year(ydsj) = Year(Now) And Month(ydsj) = Month(Now) Then syr = Fix(dqnyr - Now) - Fix(dqnyr - ydsj) '日

nowh = Format(Now, "hh")

nowm = Format(Now, "nn")

nows = Format(Now, "ss")

now1 = Date + 1

dqsyhms = now1 - Now

nowsyh = Format(dqsyhms, "hh")

nowsym = Format(dqsyhms, "nn")

nowsys = Format(dqsyhms, "ss")

ydhms = Format(ydsj, "hh:mm:ss")

ydh = Format(ydsj, "hh")

ydm = Format(ydsj, "nn")

yds = Format(ydsj, "ss")

syh = nowsyh & "+" & ydh & "=" & Val(nowsyh) + Val(ydh)
bzd = Format(ydsj, "yyyy-m-d")

If Format(Now, "yyyy-mm-dd") = Format(ydsj, "yyyy-mm-dd") Then

syh = ydh - nowh

End If

'时

sym = nowsym & "+" & ydm & "=" & Val(nowsym) + Val(ydm)

If Format(Now, "yyyy-mm-dd hh") = Format(ydsj, "yyyy-mm-dd hh") Then

sym = ydm - nowm

End If

'分

sys = nowsys & "+" & yds & "=" & Val(nowsys) + Val(yds)

If Format(Now, "yyyy-mm-dd hh:nn") = Format(ydsj, "yyyy-mm-dd hh:nn") Then

sys = yds - nows

End If
'秒

Label1.Caption = "当前时间是:" & Now & " 距 " & ydsj & "还有(" & syn & ")个年头+(" & syy & ")个月份+(" & syr & ")个日子+(" & syh & ")小时+(" & sym & ")分钟+(" & sys & ")秒;合计=: (" & sysj & ")天!"
ElseIf Now = ydsj Then

Label1.FontSize = 28

Label1.ForeColor = &HFF&

Label1.Caption = ydsj & "到了!祝您在以后的日子里万事如意,身体安康!88!88!"

Timer1.Interval = 8888
ElseIf Now > ydsj Then

Label1.FontSize = 28

Label1.ForeColor = &HFF0000

Label1.Caption = ydsj & "已经过了!祝您万事如意,身体安康!"
End If
End Sub
AiPPT
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图... 点击进入详情页
本回答由AiPPT提供
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式