Form can't get focus

etwombly

Member
Joined
Jun 8, 2007
Messages
9
Programming Experience
1-3
Greetings,

I'm having trouble refreshing my form once it loses focus to another program. My program runs through hundreds of thousands of records and performs calculations, and I want a counter to display how many records it has completed. (Ideally I want a %complete and a counter, but that's another day.)

I currently have a Label that I update during each loop iteration. I do Label1.Refresh(), and it works wonderfully as long as my form is focused. If I do anything else, browse the internet, use VS, whatever, the form turns white as if it's frozen, though it continues to run to completion.

I've tried using Me.Refresh() to no avail. Does anyone have any ideas on how to solve this problem?
 
Separate UI from long running process, don't tie your UI thread. Use a separate Thread or the BackgroundWorker component.
 
And accept that sometimes, windows will not bother repainting controls that are not on show, or belong to a minimised form
 
Back
Top