devxlogo

Closing MDI children in an MDI application

Closing MDI children in an MDI application

Question:
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?

Answer:
To completely close an MDI child form, do the following:

  1. 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).

  2. Click on the Events tabs of the Object Inspector.

  3. Double-click on the OnClose event to open a handler for it.

  4. 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.

See also  What Are International Payments, And How Do They Work?
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist