-
At the begining of long series of calculations, I want to immediately minimize or set my form's visible prop to false. In other words, make the form dissappear.
However, neither action actually occurs until the calculation are completed.
I tried refresh but it has no effect.
Any ides???
Jon
-
Have you tried to add DoEvents to your code?
-
At the begining of long series of calculations, I want to immediately minimize or set my form's visible prop to false...
You set it at the beginning to false or what? Please post some code (at least the part where you set it to false and the calculations, we may be able to help ya!
-
I do beleive you can do one of these two. And make sure you place them just before the calculation code. You can minmize or hide a form and still have the code execute correctly. This is called, "working in the background."
Code:
Form1.Hide
(or)
Form1.Visible = False
Try the Hide Method first and tell me how if it works.
-
Thanks Guys,
I got some help and found an answer. Its a game without a title bar. Has a Minimize button so people can play at work! Also has an Exit button. Program does a lot of calculating and may need to be minimized or exited during these calcs. Here's the code that works:
"Lots of Do Whiles"
"Lots of calculations"
DoEvents
If Forms.Count < 1 Then Exit Sub
"More Calcs"
"Lots of Loops"
DoEvents handles the Minimize & Exit buttons. The Exit button Unloads the form but the code will try to continue to run which results in errors. The If...Then stops the code.
Thanks for all the help,
Jon
-
You might also try a DoEvents at the beginning of each of your loops