注册 登录
编程论坛 Delphi论坛

各位高手帮小弟看看下面这段代码的意思吧!(红色部分)

tzh106 发布于 2005-12-07 12:58, 617 次点击

procedure Tmain.OpenForm(FormClass: TFormClass; var fm; AOwner:TComponent);
var
i:integer;
Child:TForm;
begin
for i := 0 to Screen.FormCount -1 do
if Screen.Forms[i].ClassType=FormClass then
begin
Child:=Screen.Forms[i];
if Child.WindowState=wsMinimized then
ShowWindow(Child.handle,SW_SHOWMAXIMIZED)
else
ShowWindow(Child.handle,SW_SHOWMAXIMIZED);
if (not Child.Visible) then Child.Visible:=True;
Child.BringToFront;
Child.Setfocus;
TForm(fm):=Child;
exit;
end;
Child:=TForm(FormClass.NewInstance);
TForm(fm):=Child;
Child.Create(AOwner);
ShowWindow(Child.handle,SW_SHOWMAXIMIZED);
end;

2 回复
#2
tzh1062005-12-07 13:01

怎么没有显示红色的部分呢!
还得把有问题的不分重新写上好了!
procedure Tmain.OpenForm(FormClass: TFormClass; var fm; AOwner:TComponent);中的 var fm; AOwner:TComponent 是什么意思?
Child:=TForm(FormClass.NewInstance);
TForm(fm):=Child;
Child.Create(AOwner);
ShowWindow(Child.handle,SW_SHOWMAXIMIZED);
是什么意思?

#3
zhangzujin2005-12-09 18:33

新建一个窗体啊.

1