Displaying 2 secondary forms from the main form and then closing both forms will cause the main form to lose focus. (another application is activated instead of mine)
Secondary forms are created either directly by the main form, or are created by the third form from the second form.
Secondary forms set by caFree in the OnClose event:
procedure TForm1.FormClose (Sender: TObject; var Action: TCloseAction);
begin
Action: = caFree;
end;
Using Delphi 2009 (Update 3 and 4) with XP SP3.
Here are my steps to reproduce the problem:
- Create New VCL Forms Applications
- Set an OnClose event as above
- Drag the button into the created form
- In the click handler, create a new TForm1 and show it below
. , . , . .
:
with TForm1.Create(Application) do
show;
?
(, , )
, delphi, caFree OnClose,
.
, Parent Main Form, , d . ( )