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