Results 1 to 9 of 9

Thread: [RESOLVED] Trying to implement a "Please wait" or "loading" window...

  1. #1

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    Resolved [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

  2. #2
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Re: Trying to implement a "Please wait" or "loading" window...

    You can change to modal one of your userforms.

  3. #3
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    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..?

    BOFH Now, BOFH Past, Information on duplicates

    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...

  4. #4
    New Member
    Join Date
    May 2007
    Posts
    5

    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.

  5. #5
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: Trying to implement a "Please wait" or "loading" window...

    Quote 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
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  6. #6

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    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!

  7. #7

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    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".

  8. #8
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: Trying to implement a "Please wait" or "loading" window...

    Use DoEvents to allow Windows to update the graphics.
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  9. #9

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    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
  •  



Click Here to Expand Forum to Full Width