Board index » delphi » MDI child from MDI child

MDI child from MDI child

What is the proper method for creating an MDI child form
from another MDI Child Form?

I have used

 Form2 := TForm2.Create(Application);

Form2 is maximized (within the MDI frame), and when closed,
I find out that Form1 (where the above statement is executed) is ALSO
maximized within the MDI frame. Is that a bug, or am I doing something
wrong with the Create method? Should I use something other than
Application as the parent?

TIA

Peter Antypas
panty...@hic.net

 

Re:MDI child from MDI child


On Tue, 07 May 1996 12:42:45 -0500, Peter Antypas <panty...@hic.net>
wrote:

Quote
>What is the proper method for creating an MDI child form
>from another MDI Child Form?

>I have used

> Form2 := TForm2.Create(Application);

>Form2 is maximized (within the MDI frame), and when closed,
>I find out that Form1 (where the above statement is executed) is ALSO
>maximized within the MDI frame. Is that a bug, or am I doing something
>wrong with the Create method? Should I use something other than
>Application as the parent?

>TIA

>Peter Antypas
>panty...@hic.net

On my Opinion, only the main window can create a child.

You can try one of the following:

1.  Form2 := MainFrame.TForm2.Create(Application) where Mainframe is
the variable of your MainWindow.

2. More interesting, you create a procedure called let's say
InitChildwindow in the Mainwindow declaration which create your TForm2
and call this procedure within you MDI Child. Note: if you want that
to be possible, don't forget to put : "uses (unit of your
mainwindow);" after the Implementation of the unit of your child.

Don't know if it works but I tried huh ?

Fabio

Re:MDI child from MDI child


Quote
Peter Antypas wrote:

> What is the proper method for creating an MDI child form
> from another MDI Child Form?

> I have used

>  Form2 := TForm2.Create(Application);

> Form2 is maximized (within the MDI frame), and when closed,
> I find out that Form1 (where the above statement is executed) is ALSO
> maximized within the MDI frame. Is that a bug, or am I doing something
> wrong with the Create method? Should I use something other than
> Application as the parent?

> TIA

> Peter Antypas
> panty...@hic.net

Nothing wrong, this is standard MDI window behaviour.

Other Threads