X xbmail Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-13 #1 有一个窗体,类名为: TForm1, 而我在运行时只知道其窗体的名为"Form1" 现我得以此字串变量来建立一个实例 (根据变量来动态调用Form) .... 请问该如何实现??
B beta Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-13 #3 FormStr := 'Form1'; TForm(Application.FindComponent(FormStr)).Caption := 'changed';
X xbmail Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-13 #4 to beta: 我的做法是: var sfrm:string frm:TForm; sfrm:='Form1'; frm:=TForm(Application.FindComponent(sfrm)).create(application); frm.ShowModal 可出错! (与你的方法其实一样)
to beta: 我的做法是: var sfrm:string frm:TForm; sfrm:='Form1'; frm:=TForm(Application.FindComponent(sfrm)).create(application); frm.ShowModal 可出错! (与你的方法其实一样)
X xbmail Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-14 #5 此问题已自行解决! 方法如下: var frm:TForm; begin frm:=TFormClass(GetClass('tform2')).Create(Application ); frm.ShowModal; frm.Free; end; initialization RegisterClasses([TForm2]);
此问题已自行解决! 方法如下: var frm:TForm; begin frm:=TFormClass(GetClass('tform2')).Create(Application ); frm.ShowModal; frm.Free; end; initialization RegisterClasses([TForm2]);