在主窗体中打开子窗体的方法
for i:=0 to self.MDIChildCount-1 do
begin
if (self.MDIChildren[i] is tform2) then
begin
self.MDIChildren[i].Show;
exit;
end;
end;
tform2.Create(self).Show;
第一个问题,我可以帮帮你哦!~
try
if Application.MainForm.MDIChildCount > 0 then
ActiveMdiChild.Close;
finally
sfrmEmpJob :=TsfrmEmpJob.Create(frmMain);
end;
不知道,看明白了吗?!
我要分分呀!~~~~
type
LCreateFormClass = class
private
public
procedure createForm(newform:TFORM;ownerform:TFORM);
end;
implementation
procedure createForm(newform:TFORM;ownerform:TFORM);
begin
try
if Application.MainForm.MDIChildCount > 0 then
ActiveMdiChild.Close;
finally
newform :=TMDICHildfrm.Create(frmMain); //其中,TMDIChildfrm是一个字窗体类
end;
end