unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,unit2;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Form2: TForm2;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
Form2:=TForm2.Create(Form1);
Form2.parent:=Form1;
end;
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
For i:=0 to ComponentCount-1 do
begin
if Components is TForm then
begin
memo1.Lines.add(Components.Name);
end;
end;
end;