dcsimg
Results 1 to 10 of 10

Thread: Way to hide MDI forms until all loaded?

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    10

    Way to hide MDI forms until all loaded?

    I'm wondering of a way to hide the slow load (and this happens on a fast computer but the video capture software I used seems to have slowed things down a bit). A rather large file is loaded just before I .show the various forms

    http://ah6le.net/rcpload.mov

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,002

    Re: Way to hide MDI forms until all loaded?

    In the old days, we would create a splash screen and show that until the MDI was ready
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    10

    Re: Way to hide MDI forms until all loaded?

    Actually I have a splash screen that appears for 5 seconds before the main form does. But that won't work to hide the MDIform load as one needs access to the GUI in order to load the file in (as my video shows)

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,002

    Re: Way to hide MDI forms until all loaded?

    So to understand this better. It's not the MDI that you want to hide, it's one of the forms opened by your menu? Not understanding the scenario completely, obviously. In your video, I'm guessing that the menu bar is on the MDI? And that form that takes forever to load is a MDI child?

    In any case, you can load a form without showing it: Load Form1. Before exiting the Form_Load event of Form1, add Me.Show.

    I think maybe more details might be helpful
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    10

    Re: Way to hide MDI forms until all loaded?

    The main form is a MDI and each tab calls a different form. And each form is populated by entries in a loaded data file. What the video shows is each of the forms as I ".show" each one after the entire data file is loaded. So I assume the issue is that of actually drawing the forms?

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,002

    Re: Way to hide MDI forms until all loaded?

    fShowForms routine you provided in your video? If so, try it.

    Instead of Analog.Show, use Load Analog. Then in Form_Load of Analog, add Me.Show before the End Sub statement. Do this for all of your forms or only for the forms that take a long time to fully load. The idea is that if a form is fully loaded before it is shown, then it should paint fairly quickly. Another option is to delay populating your controls on the slow-loading form ... something like this

    1. Take all your code from the Form_Load and add it to a subroutine, let's call it InitialzeControls
    2. Then add a timer to the form, set its Interval=0 and Enabled=True
    3. In the form's Load event..
    Code:
    Me.Show
    DoEvents
    Timer1.Interval = 20
    5. The Timer1_Timer event would simply be:
    Code:
    Timer1.Enabled = False
    IntializeControls
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    10

    Re: Way to hide MDI forms until all loaded?

    I've tried the first idea (Load Analog, etc) and that doesn't seem to make a difference. I will try your 2nd idea and let you know but I won't have a chance until a little later. Thanks for the help!

  8. #8
    Addicted Member
    Join Date
    Sep 2014
    Posts
    236

    Re: Way to hide MDI forms until all loaded?

    MDI load is so fast that often I have to let the splash stay a little bit longer after MDI has already appeared (on top of MDI of course).

    In your case, would you like to try adding a "DoEvents" (in the Form called for)?

  9. #9

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    10

    Re: Way to hide MDI forms until all loaded?

    Interesting change in behavior adding DoEvents

    http://www.ah6le.net/rcpload2.mov

  10. #10

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    10

    Re: Way to hide MDI forms until all loaded?

    Well...the cure seems to be the easiest - don't load all the forms at start up. Loading each form for the first time only takes a second or two. And that occurs only the first time a different tab is selected. I can post a video if needed but I wanted to say thanks to those who offered their ideas!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width