i have create mainform (auto create form) and Form1 (available form). the method that i use to call form1 is like this
procedure Tmainform.Button2Click(Sender: TObject);
var
f : Tform1;
begin
f:=Tform1.create(self);
f.parent:=Tabsheet1;
f.visible:=true;
f.align:=alClient;
end;
the question is why KeyPreview in Form1 does not work, even though I have activated his KeyPreview be true?
in
function TWinControl.DoKeyDown(var Message: TWMKey): Boolean;
the call is delegated to the parent if existing.The Procedure
will not be called if Form is parented