D
delphihsc
Unregistered / Unconfirmed
GUEST, unregistred user!
function ShowModalFormByClassName(const ClassName: string): integer;<br>var<br> frm: TCustomForm;<br>begin<br> frm := CreateFormByClassName(ClassName);<br> try<br> Result := frm.ShowModal;<br> finally<br> frm.Release;<br> end;<br>end;<br>function CreateFormByClassName(const ClassName: string): TCustomForm;<br>var<br> AClass: TPersistentClass;<br>begin<br> { Note that TApplication "owns" this form and thus it must be freed prior<br> to unloading the package }<br> AClass := GetClass(ClassName);<br> if AClass <> nil then<br> Result := TComponentClass(AClass).Create(Application) as TCustomForm<br> else<br> raise Exception.CreateFmt(sErrorCreateForm, [ClassName]);<br>end;<br>ShowModalFormByClassName(窗体名)<br>怎么样把上面的改成可以显示多窗体的.<br> Result := frm.ShowModal;<br>我把这句改成frm.show不行.