C# Label Text Not Updating
You're performing a lengthy operation on the UI thread. You should move it to a background thread (via BackgroundWorker
for instance) so the UI thread can do things like repaint the screen when needed. You can cheat and execute Application.DoEvents
, but I'd really recommend against it.
This question and answer are basically what you're asking:
Form Not Responding when any other operation performed in C#
use Label.Refresh(); it saves a lot of time.This should work for u
The Label doesn't re-paint until you give the UI thread back to the message loop. Try Label.Refresh, or better yet, try putting your lengthy operation in a background thread as other posters have suggested.