怎样建立dll fsMDIChild子窗体(100分)

  • 主题发起人 主题发起人 hwh6666
  • 开始时间 开始时间
H

hwh6666

Unregistered / Unconfirmed
GUEST, unregistred user!
怎样建立dll fsMDIChild子窗体?
 
Procedure InitPlug(prdParam : TrdParam);<br>&nbsp; Procedure OpenMDIChild(TfrmMDIChild: TComponentClass; var frmMDIChild: TForm);<br>&nbsp; var<br>&nbsp; &nbsp; iLoop: integer;<br>&nbsp; begin<br>&nbsp; &nbsp; //-- 1. 查询子窗体是否已经存在<br>&nbsp; &nbsp; for iLoop:=Application.MainForm.MDIChildCount-1 downto 0 do<br>&nbsp; &nbsp; &nbsp; if Application.MainForm.MDIChildren[iLoop]=frmMDIChild then<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; frmMDIChild.Show; &nbsp; &nbsp; &nbsp; &nbsp; // 已经存在, 推到前面<br>&nbsp; &nbsp; &nbsp; &nbsp; exit; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 退出<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; //-- 2. 不存在则创建<br>&nbsp; &nbsp; Application.CreateForm(TfrmMDIChild, frmMDIChild);<br>&nbsp; &nbsp; frmMDIChild.Show;<br>&nbsp; end;<br>Begin<br>&nbsp; rdParam := prdParam;<br>&nbsp; Application := prdParam.AppMain;<br>&nbsp; //<br>&nbsp; OpenMDIChild(TComponentClass(TFrmTest), TForm(FrmTest));//需修改<br>End;
 
后退
顶部