|
-
May 23rd, 2007, 03:48 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Trying to implement a "Please wait" or "loading" window...
Hey all,
I'm having some trouble (which is frustrating b/c it seems so simple) of trying to get a form which says "Please wait" or something like that display while a rather intensive method is running (anywhere from 5-15 secs long).
My code is:
Code:
Private Sub cmdCreateGraphs_Click()
frmMain.Hide
frmLoading.Show
frmGraph.FindUniqueField
frmGraph.Show
frmLoading.Hide
End Sub
With this code, the frmLoading is never hidden. It just keeps staying up there, but if you close it (much after the method has finished running), frmGraph appears with the method complete. I've tried moving around frmLoading.hide all around these 5 lines of code with no success. Also if you document out frmLoading.show/hide, everything works, save an awkward 5-10 secs where a user might think my program crashed.
Any ideas? Thanks
-
May 23rd, 2007, 06:51 PM
#2
Addicted Member
Re: Trying to implement a "Please wait" or "loading" window...
You can change to modal one of your userforms.
-
May 24th, 2007, 04:48 AM
#3
Re: Trying to implement a "Please wait" or "loading" window...
If you change to modal doesn't the program wait until the form is closed/hidden?
Break point your code to make sure it is runn as you expect it to.
Might be you need to 'force' the loading of the graph form..?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
May 27th, 2007, 05:15 PM
#4
New Member
Re: Trying to implement a "Please wait" or "loading" window...
on your loading form you may be able to implement a timer or two so that it says "please wait" for a couple seconds, and then "loading..."
I've only been programming for a week or so, but I know it would work, it's just a question of is that the look you are going for.
Let me know if you want me to explain it more thouroughly.
-
May 27th, 2007, 05:23 PM
#5
Re: Trying to implement a "Please wait" or "loading" window...
 Originally Posted by pgag45
Hey all,
I'm having some trouble (which is frustrating b/c it seems so simple) of trying to get a form which says "Please wait" or something like that display while a rather intensive method is running (anywhere from 5-15 secs long).
My code is:
Code:
Private Sub cmdCreateGraphs_Click()
frmMain.Hide
frmLoading.Show
frmGraph.FindUniqueField
frmGraph.Show
frmLoading.Hide
End Sub
With this code, the frmLoading is never hidden. It just keeps staying up there, but if you close it (much after the method has finished running), frmGraph appears with the method complete. I've tried moving around frmLoading.hide all around these 5 lines of code with no success. Also if you document out frmLoading.show/hide, everything works, save an awkward 5-10 secs where a user might think my program crashed.
Any ideas? Thanks
It sounds like your frmloading is modal itself, meaning that everything stops until you close the form, at which point the rest of it executes. Make sure the ShowModal property of the frmloading form is False.
zaza
-
May 28th, 2007, 12:01 PM
#6
Thread Starter
Hyperactive Member
Re: Trying to implement a "Please wait" or "loading" window...
ah ok, didn't know about the showmodal property... I will change that and see if that works tomorrow... thanks!
-
May 29th, 2007, 10:17 AM
#7
Thread Starter
Hyperactive Member
Re: Trying to implement a "Please wait" or "loading" window...
well that did help a bit...
But with the above code frmLoading appears and disappears at the right time, but the window itself doesn't display anything.... it is all white and looks "frozen".
-
May 29th, 2007, 03:11 PM
#8
Re: Trying to implement a "Please wait" or "loading" window...
Use DoEvents to allow Windows to update the graphics.
-
May 29th, 2007, 03:25 PM
#9
Thread Starter
Hyperactive Member
Re: Trying to implement a "Please wait" or "loading" window...
great, thanks ... working perfect now with this code
Code:
frmMain.Hide
frmLoading.Show
DoEvents
frmGraph.FindUniqueField
frmGraph.lstScenario.Clear
frmGraph.lstSoil.Clear
frmGraph.lstLine.Clear
frmLoading.Hide
frmGraph.Show
thanks all
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|