读书人

一个小疑点

发布时间: 2012-01-20 18:53:53 作者: rapoo

一个小问题
Private Sub Form_Load()
Timer1.Interval = 1
End Sub

Private Sub Timer1_Timer()
time1 = Time
If time1 = "#9:21:00# " Then
Label1.Caption = time1
End If
End Sub请各位帮我看看有什么问题.怎么没有反应啊?

[解决办法]
给你看了一下,下面可以:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
Timer1.Interval = 1
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim Time = Format(Now(), "H:mm:ss ") '时分秒
Dim time1 As DateTime
time1 = Time
If time1 = "#8:47:00# " Then
Timer1.Enabled = False
Label1.Text = Time
End If

End Sub

读书人网 >VB Dotnet

热点推荐