Form1
Uses unit2;
Procedure TFORM1.FormCreate (Sender: TOBJECT);
Begin
Form2: = TFORM2.CREATE (Panel, Self);
Form2.borderstyle: = bsnone;
Form2.windowState: = wsmaximized;
Form2.parent: = panel;
Form2.show;
END;
Form2
Uses unit1;
Private
FOWNERFORM: TFORM;
END;
Constructor Create (Aowner: Tcomponent; Ownerform: TForm); Reintroduce;
Constructor TFORM2.CREATE (Aowner: Tcomponent; Ownerform: TFORM);
Begin
Inherited Create (Aowner);
FOWNERFORM: = OwnerForm;
END;
Event trigger (in Form2 to respond to Form1 events)
Procedure TFORM2.BUTTON1CLICK (Sender: TOBJECT);
Begin
IF self.fownerform.classtype = tform1 Then
Begin
ShowMessage ('a');
END;
END;