vb.net 在规定的时刻触发某个事件。怎么实现?

2024-11-24 11:11:37
推荐回答(1个)
回答1:

窗体上添加一个

Label1
Timer1
再添加2个窗体
代码如下:

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = Now
Select Case Hour(Now)
Case 10
Form2.Show()
Case 11
Form3.Show()
End Select
End Sub
End Class