这是另一种方法,可参考:
procedure TForm1.Button1Click(Sender: TObject);
var
AForm: TForm;
FormClass: TComponentClass;
begin
FormClass := TComponentClass(FindClass('TForm2'));
Application.CreateForm(FormClass, AForm);
AForm.Show;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterClasses([TForm2]);
end;