for I := application.ComponentCount- 1 downto 0 do
begin
if application.Components is TForm then
begin
formName:=TForm(application.Components).name;
.........
为了更清楚的说明我的意思,我把调用时动态创建窗体的代码贴出来,大侠一看就明白了:
procedure TfrmMain.N1Click(Sender: TObject);
begin
if not Assigned(Form1) then
Form1 := TForm1.Create(Application);
end;
朋友们帮忙啊!!