Hi,

Does anyone know how to create a delay in C#?

I dont like to use Thread.Sleep because it makes the GUI unresponsive.

Do you know of any good alternatives?

Recommended Answers

Use more than one thread. Then you can use thread.sleep on the thread doing the work but leave the main thread active.

Jump to Post

All 2 Replies

Use more than one thread. Then you can use thread.sleep on the thread doing the work but leave the main thread active.

What do you mean delay?
Create a new thread, put some timer on it, and show update some control like label to notify a user ther is something going on (ie: wait: seconds) by using delgate for updating a control (from another treead to ui thread).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.