Board index » delphi » MDI without the main form being a MDI form

MDI without the main form being a MDI form

Hello all.

In my project I would like to have a form, that is not the main form, be a
MDI form
and then have multiple children in it.

Is this even possible?

The only solution I have found is to make my main form and the should be MDI
form a MDI,
but then when I tell my non main form to create a MDI child, it creates
children in the
main form. Although I pass self to the child.

thanks for all the help!

greetings

Frank

 

Re:MDI without the main form being a MDI form


On Fri, 27 Sep 2002 07:43:07 +0200, "Stephan-Frank Henry"

Quote
<stephan-frank.he...@NOSPAMwarema.de> wrote:

You can't do "true" MDI the way you're trying. You can however specify
a form as a parent of another when dynamically created. For example,
if you have a project with two forms, and "unit2" is in the "unit1"
uses clause, then some code much like this:

procedure TForm1.Button1Click(Sender: TObject);
var
  f2 : TForm2;
begin
  f2 := TForm2.Create(Self);
  f2.Parent := Self;
  f2.Visible := True;
end;

will do sort of what you want. Kinda. Try it.

I know it's not my place to say, but you may also want to consider
other interface designs. MDI is a dying animal anyway, and a
non-standard impersonation of it may be confusing to users.

--
Jeremy

Quote
>In my project I would like to have a form, that is not the main form, be a
>MDI form
>and then have multiple children in it.

>Is this even possible?

>The only solution I have found is to make my main form and the should be MDI
>form a MDI,
>but then when I tell my non main form to create a MDI child, it creates
>children in the
>main form. Although I pass self to the child.

Re:MDI without the main form being a MDI form


"Jeremy Collins" schrieb im Newsbeitrag ...

Quote
> On Fri, 27 Sep 2002 07:43:07 +0200, "Stephan-Frank Henry" wrote:

> You can't do "true" MDI the way you're trying. You can however specify
> a form as a parent of another when dynamically created. For example,
> if you have a project with two forms, and "unit2" is in the "unit1"
> uses clause, then some code much like this:

> procedure TForm1.Button1Click(Sender: TObject);
> var
>   f2 : TForm2;
> begin
>   f2 := TForm2.Create(Self);
>   f2.Parent := Self;
>   f2.Visible := True;
> end;

> will do sort of what you want. Kinda. Try it.

> I know it's not my place to say, but you may also want to consider
> other interface designs. MDI is a dying animal anyway, and a
> non-standard impersonation of it may be confusing to users.

It's exaclty what I needed.
thank you very much for the answer.

Frank

- Show quoted text -

Quote
> >In my project I would like to have a form, that is not the main form, be
a
> >MDI form
> >and then have multiple children in it.

> >Is this even possible?

> >The only solution I have found is to make my main form and the should be
MDI
> >form a MDI,
> >but then when I tell my non main form to create a MDI child, it creates
> >children in the
> >main form. Although I pass self to the child.

Other Threads