Click to See Complete Forum and Search --> : Loading forms
Klas Pettersson
Jan 23rd, 2000, 12:47 AM
I have a few mdichilds in a MDI form. When I run my app the mdi form loads quickly. But in the mdichild forms I have a lot of controlls so they take a while to load the first time.
Is there any why to load these bigger mdichilds when the mdi form loads. Then I'll divide the loading time and my app will feel faster.
Civil78
Jan 23rd, 2000, 03:18 AM
Hi...
You can write in Mdiform_load
Private Sub MdiForm_Load()
Load FormName
End Sub
And to see the form type
Private Sub Command1_click()
FormName Show
End Sub
I hope that is help you
[This message has been edited by Civil78 (edited 01-23-2000).]
Klas Pettersson
Jan 23rd, 2000, 04:05 AM
But Load myform made my form visible. So I had to hide it again and then I got a blink.
chrisjk
Jan 23rd, 2000, 09:09 AM
All MDI Childs are loaded automatically when the MDI parent form is loaded...
------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)
Phobic
Jan 23rd, 2000, 09:17 AM
chrisjk is incorrect, the only mdi childs shown in startup is if a mdichild is set to load first, so the mdiparent is automatically loaded before that.
Civil78 should be right, just put whatever mdichilds you want to be loaded in the mdiparent's load event (Load MDIChildName). The should not show from this, only load.
Klas Pettersson
Jan 24th, 2000, 03:09 PM
I must be stupid because if I create a new project with only a MDI form and a MDI child. I set the MDI form to startup form and then I write:
Load Form1 ' Which is the MDI child
Now Form1 is visible. What can I do if I want to load a form without showing it?
XMortal
Jan 24th, 2000, 03:29 PM
Klas, using form1.load in the beginning will load form1 into memory but not show it, using form1.show will display the form.
if it isnt loaded form1.show will load it when necessary
also form1.unload takes it out of memory and form1.hide takes it out of dispaly, unload will also hide the form
these can be called from the child forms or parent forms i think, if not put it in the mdiparent module and call it but thats harder to think about
hope its cleared up
btw, if anyone has it i need filecopy source code
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.