我试图在我的控制台应用程序中使用Timer控件.
Friend WithEvents XTIMER As System.Windows.Forms.Timer
Run Code Online (Sandbox Code Playgroud)
我正在设置它的所有属性.我已将间隔设置为15000毫秒.但即使我将定时器控件的Enabled状态设置为true,也不会触发tick事件.有人可以帮帮我吗?
dba*_*ett 11
Module Module1
Sub Main()
aTimer.AutoReset = True
aTimer.Interval = 2000 '2 seconds
AddHandler aTimer.Elapsed, AddressOf tick
aTimer.Start()
Console.ReadKey()
End Sub
Dim aTimer As New System.Timers.Timer
Private Sub tick(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs)
Console.WriteLine("tick")
End Sub
End Module
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
39087 次 |
最近记录: |