执行等待计时器时,我在sub中发出一声嘟嘟声。哔哔声发生在doevents上,似乎只在第一次调用sub时发生(所以在第一次等待时)。这听起来像一个消息框弹出蜂鸣声。有没有人有任何想法?
Private Sub wait(ByVal interval As Integer)
Dim stopW As New Stopwatch
stopW.Start()
Do While stopW.ElapsedMilliseconds < interval
' Allows your UI to remain responsive and apparently is causing beeping
My.Application.DoEvents() ' I get a beep when this line is executed
Loop
stopW.Stop()
End Sub