Solved

Close MDI Childs

Posted on 1997-11-20
3
272 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 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

11 Experts available now in Live!

Get 1:1 Help Now