Click to See Complete Forum and Search --> : Unload statement
rlecjr
April 13th, 2001, 10:56 AM
I think this is a beginner question:
I have a child form that triggers another child form to open. The second child form is smaller and loads over the first child. I am disabling the first child form so that the user can see part of it but cannot access it. When the user clicks a 'Close' button on the second child form, it should unload, and enable and return to the first form. In the close routine of Form2, I placed an 'Unload Me', but it unloaded both childs apparently because they were both visible. I tried an 'Unload Form2', but that didn't do a thing. How do I unload just Form2?? Hope this makes sense. Thanks in advance for any help!!
vbgrammer
April 13th, 2001, 11:22 AM
Show that part of code and I can help
rlecjr
April 13th, 2001, 11:38 AM
There is not much to show, but here it is:
'IN FORM1:
private Sub command_Click()
me.enabled = false
'Opens Form2 on top of Form1 - Form2 is
'smaller, so they both can be seen.
Form2.Show
End Sub
'IN FORM2:
private Sub cmdClose_Click()
'This Unload me is unloading both forms.
'I need to only unload Form2.
Unload me
Form1.Enabled = true
End Sub
Thanks,
Ron
shree
April 13th, 2001, 11:48 AM
Instead of disabling and enabling forms, you can just use
Form2.show vbModal
in Form1 and
Unload Me
or
Me.Hide
in Form2
rlecjr
April 13th, 2001, 12:00 PM
Thanks and sorry for the stupid question. That works good. Just a follow-up though. What is standard for Form sizes? The way I am creating the application is mostly an MDIparent with menus and a constant flow of MDIChilds within the parent. I create them all the same size and run it.. one form opening at a time. Is there some sort of standard that is known for how large you should create forms or is it relatively open to the environment and type of application? Just thought I'd ask the gurus while I am here.
Thanks again!
shree
April 13th, 2001, 12:07 PM
There is no hard and fast rule as I know of, but most MDI applications have the MDI form maximized in the beginning. The child form also opens maximized, and the child form is usually of the sort that it has one control (a picture box or textbox, or richtextbox) that expands to fill most part of the child form. Depends upon your application, however. It is always wise to consider the different resolutions and screen sizes that the user has, and design your form such that it looks consistent over all screen sizes.
rlecjr
April 13th, 2001, 12:25 PM
Thanks for the tips shree. Have a nice weekend!
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.