Function TFrm_Main.PRF_Openwindow(as_Fromname:string):integer;
var
FcType : TFormClass;
Frmname:string;
begin
try
Frmname:= as_Fromname;
FcType := TFormClass(FindClass(Frmname));
Application.CreateForm(Fctype,OpenWindow);
OpenWindow.Showmodal;
except
ShowMessage('Form Type not exist,you must register it first');
end;
Result := 0;
end;
需要在pas文件中加
initialization
RegisterClass(窗体类名);