I have made an MDI application with many MDI children, but when I try to close an MDI child it becomes minimized. How can I avoid this and close the window?
To completely close an MDI child form, do the following:
- Display your child form in the IDE, making sure you’re selecting theform itself, not one of its components (hint: look at the ObjectInspector to see if the currently displayed component is actually the formitself).
- Click on the Events tabs of the Object Inspector.
- Double-click on the OnClose event to open a handler for it.
- Type the following in the begin and end block:
Action := caFree;Save your file, compile your project and run. Now, when you close the form,it will truly close.