MDIForm Parent/Child forms BEST Practice

From: Edwinah63 (edwinah_at_customercare.com.au)
Date: 04/22/04


Date: 21 Apr 2004 18:52:43 -0700

Hi everyone,

could someone give me some thoughts on the best way to manage mdi
parent and child forms?

in vb6 i could scroll through the forms collection and determine which
forms were open/closed and their current state. now i can't.

before i didn't have to declare numerous named instances each time i
loaded or unloaded a form.

if i open a child form from another child form and try to assign
mdimain as the mdiparent it doesn't permit it, if i say f1.mdiparent =
me.mdiparent i get memory problems (as have others judging from the
groups).

all my current forms are declared public shared in mdiMain, but should
these be in a user made forms collection owned by a global module
(cMain)?

if i am finished with a child form, i want to unload it, not hide it,
but if i close a form in vb.net it extinguishes the instance.

when the mdi parent closes, i would like the app to terminate.

should i be setting mdi children to nothing or disposing them?

basically, what can/should i do to get the same mdi parent/child
management present in vb6 while still preserving the smallest
footprint possible in memory?

all comments/code greatly appreciated. i am probably not the only
programmer to ponder this question.

regards

Edwinah63



Relevant Pages

  • Re: My.Application.OpenForms
    ... ' parent the form the the MDI Container ... ' make the form fill the client area of the MDI Container ... Have you solved the problem of sizing a child form to fit the MDI client ... 'enable application framework' checkbox is unchecked. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Moving the MdiClient area
    ... MDI interface looking just like Outlook. ... 3D border on the MdiClient using Interop. ... When trying to open MDI child forms, I first received an error about ... MDI child form before displaying it: ...
    (microsoft.public.dotnet.framework.windowsforms)
  • RE: MDI child forms without title bars
    ... Don't set WindowState to Maximized and the title bar goes away. ... knows it's a child form and seemingly maximizes the child form so you don't ... see the backcolor of the MDI parent. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: bug: active MDI child window does not show the menu
    ... So either you create an empty menu for the MDI form your you hide the MDI's menus. ... So the menu is only created once - on the MDI parent and all ... The problem is the menu is not displayed ONLY for the active child, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Centering a MDI Child Form
    ... Your title mentions you're trying to position an MDI child form and so I ... assume your parent form is an MdiParent (the IsMdiContainer property is set ... If your parent is an mdi container (in which case it will be the ...
    (microsoft.public.dotnet.languages.vb)

Loading