在Visual Basic中是否有任何命令可以在我每次选择时执行函数,就像在Javascript中的setInterval一样
答案 0 :(得分:5)
Sub Main()
Dim Timer As New Timers.Timer(1000) '1000 ms
Timer.AutoReset = True
AddHandler Timer.Elapsed, AddressOf TimerElapsedHandler
Timer.Start()
End Sub
Private Sub TimerElapsedHandler(ByVal sender As Object, ByVal e As Timers.ElapsedEventArgs)
'do stuff here
End Sub