VB.NET公共场合倒计时牌程序

前端之家收集整理的这篇文章主要介绍了VB.NET公共场合倒计时牌程序前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Private Sub Form1_Load(sender As Object,e As EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As Object,e As EventArgs) Handles Timer1.Tick
Dim m As Integer,d As Integer,min As Integer,s As Integer,h As Integer
min = 59 - DateTime.Now.Minute()
s = 59 - DateTime.Now.Second()
h = 23 - DateTime.Now.Hour()
m = 12 - Month(Today())
If m = 1 Then
d = d + 30 - DateTime.Today.Day() + 22
Else
d = 22 - DateTime.Today.Day()
End If
Label1.Text = "现在离英语四级考试还有" + Format(d,"00") + "天" + Format(h,"00") + "小时" + Format(min,"00") + "分钟" + Format(s,"00") + "秒。"
End Sub
关于英语四级的倒计时,想了好久终于写出来了。
原文链接:https://www.f2er.com/vb/259306.html

猜你在找的VB相关文章