I'm using delphi 2007 and each time which I create a new form using a code like this
var
Child : TFrmChild;
begin
Child:=TFrmChild.Create(Self);
Child.Show();
end;
The child form is shown and appears above all others forms , that is ok, but when a click in the main form the child form stays above of the main form. so i have two questions
Thanks
UPDATE
this is the dfm of the child form
object FrmChild: TFrmChild
Left = 549
Top = 308
Caption = 'FrmChild'
ClientHeight = 228
ClientWidth = 213
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
end
You have two top level windows. The main form is the owner of the child form. Owned windows always appear above their owners, that's just one of the rules of Windows.
Note that by owner I am referring to the Windows concept rather than the Delphi concept.
The Windows Features topic explains the rules. The key statement is:
An owned window is always above its owner in the z-order.
As for how to make you app behave differently I'm not so sure. If you make your child form unowned then it will have its own taskbar button and it won't be minimised when the main form is minimised, for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With