ntony
asked on
MDI Child Close Event
I have an MDI application. I want to know if there is an event for child close.
i've tried :
if Message.Msg=WM_MDIDESTROY then begin
ShowMessage('Child closed');
end else inherited WndProc(Message);
but it does not work. Can anyone tell me why?
i've tried :
if Message.Msg=WM_MDIDESTROY then begin
ShowMessage('Child closed');
end else inherited WndProc(Message);
but it does not work. Can anyone tell me why?
why not use the onClose.event of your MDIChild?
ASKER
I have a list with child window so i need to delete the child when it will be closed.
Is the childform really closed in your program.
You can try to write some codes in the two event:OnClose,OnDestroy.
Just like showmessage('c') in onclose;showmessage('d') in onDestroy.
You will find that when you close the Childform,only show "c" ;
When you add "action :=caFree" in OnClose,you will see "d";
So...maybe you will find the right answer.
I guess but not test the following code;
if Message.Msg=WM_Close then begin
ShowMessage('Child closed');
end else inherited WndProc(Message);
you could notify the mainform in the onClose-event of your MDIChilds instead
may this possible for you?
may this possible for you?
ASKER
huiyue i've used caFree on the child form.
Kretzschmar - i need a simple solution
how shows your list?
by classname or by formname?
by classname or by formname?
ASKER
is't a stringlist with objects TForm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.