Solved

Close MDI Childs

Posted on 1997-11-20
3
273 Views
Last Modified: 2012-05-04
I made an MDI application, but when I close an MDI Child,
instead of close, the MDI Child is Minimized.
Can anyone tell what can I do to really close this windows.
Thanks.
Best Regards.
0
Comment
Question by:Nuno Alves
3 Comments
 

Expert Comment

by:dr_gonzo
ID: 1351088
Some thing that is funny, is to free the memory of the
window class.
(But this is my method in C, and my brain is the size of a wal(l)nut)

But me(Gonzo) and my friend(Acid Smurf)'s tips is:

procedure Form1Close(Sender : TObject);
begin
   Form1.Visible := False;
end;

Then the user is stupid and believes the window is destroyed.

MTFBWU,
Dr. Gonzo & Acid Smurf & Mr Pipe

0
 
LVL 1

Author Comment

by:Nuno Alves
ID: 1351089
The user maybe stupid but delphi it isn't. When you try to
hide (visible := False) an MDI Child the following message
appears: Can't Hide an MDI Child.
Thanks for gonzo's help anyway.
0
 
LVL 3

Accepted Solution

by:
d4jaj1 earned 50 total points
ID: 1351090
This code actally closes the MDI child form.  Use in the FormClose Event.

procedure TChildForm.FormClose (Sender: TObject;
  Var Action: TCloseAction);
Begin
  Action := caFree;
end;

That's it. Call the form's Close actions as you normally would via a button or menu item and the MDI Child actually closes instead of minimizes.

Any questions, please add a coment.

Good Luck!

Jay
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now