Mega Code Archive

 
Categories / Delphi / Examples
 

Closing an mdi child

Question: When I try to close an MDI child form, it only minimizes. How can I make it close when the user clicks on the 'close' icon? Answer: Indeed by default MDI children are minimized instead of closed. You can override this by defining a OnClose event like the following: procedure TMDIForm1.FormClose(Sender: TObject, var Action: TCloseAction); begin Action := caFree; end;