Board index » delphi » HOWTO create Dlg then MDI form then MDI child

HOWTO create Dlg then MDI form then MDI child

hello,
My main dialog is a dialog base form.
When a button is pressed I create the MDI form.

(code in DLG)
var visu : TFRM_MDI;
        MDI:=TFRM_MDI.Create(self);

Works fine,
BUT in the MDI form when I create the child I get
an exception, "cannot create form, no non MDI form active"

(code in MDI)
var Mon : TFRM_MDIChild;
        Mon := TFRM_MDIChild.Create(FRM_MDI);

someone knows what's wrong?
thanks for helping
BZH

 

Re:HOWTO create Dlg then MDI form then MDI child


The Delphi MDI system requires that Application.MainForm is the MDI parent.
Since you have no write permission for Application.MainForm you have to
create the MDI parent first and set Application.ShowMainForm to False. Next,
you can create and show your dialog form and the button press should only
show the MDI parent (not create it).

"Breizh" <m...@myemail.com> schreef in bericht
news:Xns9072721EECC68marcmyemail@212.27.32.76...

Quote
> hello,
> My main dialog is a dialog base form.
> When a button is pressed I create the MDI form.

> (code in DLG)
> var visu : TFRM_MDI;
>     MDI:=TFRM_MDI.Create(self);

> Works fine,
> BUT in the MDI form when I create the child I get
> an exception, "cannot create form, no non MDI form active"

> (code in MDI)
> var Mon : TFRM_MDIChild;
> Mon := TFRM_MDIChild.Create(FRM_MDI);

> someone knows what's wrong?
> thanks for helping
> BZH

Re:HOWTO create Dlg then MDI form then MDI child


thank you very much for your help.
:-)
Bzh

"M.H. Avegaart" <avegaartNOS...@mccomm.nl> wrote in
<99sca9$dq...@porthos.nl.uu.net>:

Quote
>Application.ShowMainForm

Other Threads