<!--CodeS-->
//호출 예
procedure TForm1.Button1Click(Sender: TObject);
var
fc : TFormClass;
fm : TForm;
i : integer;
begin
if GetClass('TForm2') <> nil then begin //RegisterClass에서 있는지 검사
fc := TFormClass(GetClass('TForm2'));
if (assigned(fc)) then begin
fm := nil;
for i := 0 to Screen.FormCount-1 do begin //중복 생성을 막음
if (Screen.Forms[i].ClassName = fc.ClassName) then begin
fm := Screen.Forms[i];
break;
end;
end;
if not assigned(fm) then fm := fc.Create(nil); //폼 생성
fm.Show
end;
end;
end;
<!--CodeE-->