procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
Memo1.Lines.Clear;
Memo2.Lines.Clear;
for i:=1 to ComponentCount do
begin
Memo1.Lines.Add(Components[i-1].ClassName);
if Components[i-1].ClassName='TDataSource' then
Memo2.Lines.Add(Components[i-1].Name);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
Memo1.Lines.Clear;
Memo2.Lines.Clear;
for i:=1 to form2.ComponentCount-1 do
begin
Memo1.Lines.Add(form2.Components[i-1].ClassName);
if form2.Components[i-1].ClassName='TDataSource' then
Memo2.Lines.Add(form2.Components[i-1].Name);
end;
end;
for i:=1 to application.ComponentCount-1 do
showmessage(inttostr((application.Components as Tform).componentcount));
这个可以取得你的程序中所有的窗体,第0个是空的,
至于有没有USE到....就不知道了丫....