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;
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;