Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Long VB Program - Windows Content Not Visible / Refreshed

Status
Not open for further replies.

dumpsolver

Programmer
Aug 9, 2003
1
AU
I have written a program (VB6) that times a lot of time to run. The problem is that whilst running the contents of the form (the window) are not visible / refreshed. I have tried the controls such as label.refresh and form.refresh but still it does not work. Ive read that Windows is supposed to take care of this. Please assist.
 
Firstly Dumpsolver Welcome to tek-tips. I see that this is your first post here. I hope that you will stay around and share youur knowledge with others.

I suggest that you look up DoEvents in MSDN. It "forces" VB to process other messages in the message queue. Placing this at the end of the loop (i assume that you are using) will allow the screen to update. As an effeciency note, you might only want to doevents every 5 or 10 time thorugh the loop.

i.e
Code:
begining of loop code
....


if intTimesThroughLoop mod 10 = 0 then
  Doevents
end if
intTimesThroughLoop = intTimesThroughLoop + 1

loop
May I also suggest that forum222 might have been a better place for this question.

Finally, there is a FAQ that perhaps you could read that will stand you well for getting the most out of these forums! Its faq222-2244



Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top