您的位置:首页 > 编程语言 > VB

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

2012-12-16 09:35 369 查看

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

关于英语四级的倒计时,想了好久终于写出来了。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: