• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 606
  • Last Modified:

System.Windows.Forms.Form how yield thread to let other UI elements draw?

In an event method (e.g., webbrowser1_DocumentCompleted), how do I yield the thread to let other threads run, then come back?
1 Solution
Fernando SotoRetiredCommented:
By inserting a Application.DoEvents() call in the code that is currently executing will allow the UI thread to execute messages that are waiting to be processed and then return to the previous running code. So each time a Application.DoEvents() is executed the above will happen.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now