首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

一个小疑点

2012-01-20 
一个小问题PrivateSubForm_Load()Timer1.Interval1EndSubPrivateSubTimer1_Timer()time1TimeIftime1#9

一个小问题
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

热点排行