1
返回它这个函数创建TEDIT类型的控制对象,并将其返回到它发生的代码的任何行从调用:创建一个控制对象和函数在Delphi
function TBaseForm.CreateEdit(AOwner: TWinControl;
inTop, inLeft, inWidth: integer) : TEdit;
var
edt: TEdit;
begin
edt := TEdit.Create(AOwner);
with edt do begin
Parent := AOwner;
Width := inWidth;
Top := inTop;
Left := inLeft;
end;
result := edt;
end;
在后来代码:
edtTitle := CreateEdit(Self, 20, 90, 300);
现在。函数中的代码没有任何问题吗?例如,有什么东西没有挂在内存的某个地方?
你应该解释为什么* *是没有泄漏。 – 2013-04-21 07:41:34