I have a Windows form that I'd like to be able to refresh with a status of the work that's going on in the background in different threads.
Problem is, even if I change the label on the form, it doesn't immediately refresh; it seems that the work happening on the other worker threads is preventing the screen from updating.
How do I force the form to refresh the ne开发者_JAVA技巧w value of the status label immediately?
Shortest path:
label1.Text = "....";
label1.Update();
I asked a similar question a few days ago.
The best option, that I'm using now, is a separate thread running a status form.
This is the suggested solution, that I received, which works by displaying a form, which then updates on a 'tick', and ensures that regardless of whether the UI on your app is updated or not, the status form is updated.
Cheers
精彩评论