0

执行等待计时器时,我的潜艇发出哔哔声。哔声发生在 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
4

0 回答 0