procedure中要用到TForm1.create(self);但是不知道如何传递?下面的写法是不对的:
procedure TDataModule1.CallDockForm(ChildForm:TForm);
begin
if not Assigned(ChildForm) then
begin
ChildForm := TChildForm.Create(Self);
end
else
ChildForm.BringToFront;
end;
编译说TChildForm未定义。
procedure TDataModule1.CallDockForm(ChildForm:TForm);
begin
if not Assigned(ChildForm) then
begin
ChildForm := TChildForm.Create(Self);
end
else
ChildForm.BringToFront;
end;
编译说TChildForm未定义。
哪儿有什么TChildForm?
我刚试过,用ChildForm.ClassType.create也不行。
不过肯定有办法解决。
说说你的需求吧。
2、改成下面的样子试试procedure TDataModule1.CallDockForm(ChildForm:TChildForm);
begin
if not Assigned(ChildForm) then
begin
ChildForm := TChildForm.Create(Self);
end
else
ChildForm.BringToFront;
end;