문제

I am using Visual Basic.net with a BackGround Worker. I am wanting to wait for x milliseconds but to update a Label with the current wait value.

How can I do this?

I am using this code at the moment:

Threading.Thread.Sleep(5000)

What else can I use as the above code does not inform me of the sleep progress?

도움이 되었습니까?

해결책

Im not sure what you mean, but here is a similar code to yours. Hope it helps!

Dim EndTime As DateTime = DateTime.Now.AddSeconds(TimeToWaitInSeconds)
While DateTime.Now < EndTime
    Application.DoEvents()
End While
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top