In the application I need to change the label text fast in a loop but it can't be done and it shows nothing till (kinda hangs) the end of the loop. I dont want to make delay in the loop to have this label shown, so how can i do that?
Printable View
In the application I need to change the label text fast in a loop but it can't be done and it shows nothing till (kinda hangs) the end of the loop. I dont want to make delay in the loop to have this label shown, so how can i do that?
In your loop try
lbl.Text = sometext
lbl.Refresh
Hope that works
Harold Hoffman
Application.DoEvents will force it to show alos but it will slow down your loop a little bit too.
Thank you!
That worked, but still if the form loses its focus then the label is not drawn, again till the end of the loop.
The previous answer was for HAROLD HOFFMAN :)
Application.DoEvents() did its best :)