Working with MDI Forms in Delphi

Open your frmChild and include the FormClose event to your Unit.In uChild.pasprocedure TfrmChild.FormClose(Sender: TObject; var Action: TCloseAction);begin Action := caFree; Release; frmChild := nil;end;With this code set, you’ll notice now that when you open your application only the parent form is auto-created, then if you click in the button the child form is created and you can close the child form whenever you want.AdjustmentsWhen droping some widgets to your Child Form you will notice that it may not fit the full screen, eventhough it is maximized.To fix that you must drop a TPanel in your Child Form, change its width and height to ocuppy the full screen and set its alignment property to alClient in the Object Inspector.To set Align to alClient just click in the middle big box.After that, you can drop your widgets inside your panel so they will also fit the entire screen.Remember that for some widgets you need to set Anchor property Top,Left,Right and Bottom to True so they can follow along with the panel size.. More details

Leave a Reply