这段代码做什么的 ?(206分)

  • 主题发起人 主题发起人 string111
  • 开始时间 开始时间
S

string111

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tmainfrm.OpenForm(FormClass: TFormClass; var fm; AOwner:TComponent);
var
i: integer;
Child:TForm;
b:boolean;
begin
B:=FALSE;
try
if self.MDIChildCount>=1 then
begin
for i := self.MDIChildCount-1 downto 0 do
if self.MDIChildren.ClassType=FormClass then
begin
Child:=self.MDIChildren;
LockWindowUpdate(Child.Handle);
if Child.WindowState=wsMinimized then
ShowWindow(Child.handle,SW_SHOWNORMAL)
else
ShowWindow(Child.handle,SW_SHOWNA);
if (not Child.Visible) then Child.Visible:=True;
Child.BringToFront;
Child.Setfocus;
TForm(fm):=Child;
b:=true;
LockWindowUpdate(0);
Break;
end;
if b then exit;
end;
Child:=TForm(FormClass.NewInstance);
TForm(fm):=Child;
Child.Create(self);
except
on EAccessViolation do
begin
end;
end;
//closeactiveform(child.name);
end;
 
MDI工程中的子窗体控制啊,如果有或最小化就把他置为正常,显示最前,如果没有该子窗体就创建它。
 
打开MDI窗体的
 
后退
顶部