我在vb6中得到了这个代码
Private Sub pause(ByVal interval As Variant)
Dim Current As Variant
Current = Timer
Do While Timer - Current < Val(interval)
DoEvents
Loop
End Sub
如何在 vb.net 中转换?我已经尝试过这种方式,但它不起作用。
错误在哪里?
Private Sub pause(ByVal interval As Single)
Dim newDate As Date
newDate = DateAndTime.Now.AddSeconds(interval)
While DateAndTime.Now.Second <> newDate.Second
Application.DoEvents()
End While
End Sub
谢谢