Board index » cppbuilder » MDI Child misbehaves! - the child will not close

MDI Child misbehaves! - the child will not close

Hi, I have built an MDI Application that creates children on run time.
All information on the child is presented as should be. All other window
events appear to be performing as required.
But I can not close a child. The active child minimizes, maximizes O.K.
but when
you click the X square, it only minimizes, it is still alive in the
bottom of the parent's client.
Reading what was posted earlier on this newsgroup, I've tried different
but none have worked so far.

on the Child OnClose Event:

void __fastcall TPSRMainForm::FormClose(TObject *Sender,
      TCloseAction &Action)
ActiveMDIChild->Close(); // will not work
//  or
// ActiveMDIChild->Release(); // will create an access violation error?


what am I missing?
thanks in advance.

Re:MDI Child misbehaves! - the child will not close

To have your window close instead of minimize, set the OnClose Action
property to caFree.

void __fastcall TMDIChildForm::OnFormClose(TObject *Sender, TCloseAction
Action = caFree;



Other Threads