Confused about paint, refresh, focus for form...
Posted on 2004-11-30
I have a VB program that reads some large text files and processes the data in them; it can take several minutes to run. Form "frmProgress" contains the guts of the code, and is displayed while the processing is going on. (The processing code is executed from its load event.) It has some informative information displayed (using label controls), and it also has a progress bar that is updated while the code runs. My problem is this: if I open another app and its window covers my "Progress..." form, when I try to go back to my "Progress... " form, the only thing on it is the progress bar ... presumably because this bar gets refreshed every time I read & process a line from a file. Why doesn't all the other stuff "repaint"? If I do a form refresh at the same time that I do the progress bar refresh, the form looks too jumpy ... isn't there something that is supposed to automatically repaint my window when its covered/uncovered? Or has focus and then loses focus? This must be a really simple thing, but I just can't figure it out ... even after paging through multiple manuals that I have. I guess I just don't know what I'm supposed to be looking for! Help!