Private Sub XX()
Dim t As New System.Timers.Timer
AddHandler t.Elapsed, AddressOf theout
t.AutoReset = True
t.Enabled = True
End Sub
Public Sub theout(ByVal source As Object, ByVal e As System.Timers.ElapsedEventArgs)
MsgBox("OK!")
End Sub
Dim t As New System.Timers.Timer(10000)
'实例化Timer类,设置间隔时间为10000毫秒;
AddHandler t.Elapsed, New System.Timers.ElapsedEventHandler(theout)
'到达时间的时候执行事件;
t.AutoReset = True
'设置是执行一次(false)还是一直执行(true);
t.Enabled = True
'是否执行System.Timers.Timer.Elapsed事件;
Public Sub theout(source As Object, e As System.Timers.ElapsedEventArgs)
MessageBox.Show("OK!")
End Sub