代码如下:
procedure CreateControl(Tselfcontrol:TWinControl:EdLeft,EdTop:Integer;Parent:TWinControl);
var selfcontrol: Tselfcontrol;//系统提示:Constant or type identifier expected
begin
selfcontrol := Tselfcontrol.Create(self);
selfcontrol.Top := EdTop;
selfcontrol.Left := EdLeft;
if Parent <> nil then
selfcontrol.Parent := Parent;
else
selfcontrol.Parent := self;
selfcontrol.Show;
end;
请问该怎样修改才能达到我的要求
procedure CreateControl(Tselfcontrol:TWinControl:EdLeft,EdTop:Integer;Parent:TWinControl);
var selfcontrol: Tselfcontrol;//系统提示:Constant or type identifier expected
begin
selfcontrol := Tselfcontrol.Create(self);
selfcontrol.Top := EdTop;
selfcontrol.Left := EdLeft;
if Parent <> nil then
selfcontrol.Parent := Parent;
else
selfcontrol.Parent := self;
selfcontrol.Show;
end;
请问该怎样修改才能达到我的要求
procedure CreateControl(Tselfcontrol:TWinControl://TSelfControl???????
EdLeft,EdTop:Integer;Parent:TWinControl);
EdLeft,EdTop:Integer//控件的位置参数
Parent:TWinControl//控件的Parent
谢谢了
TSelfcontrol=TWincontrol;//////////////////////////
//...
procedure TForm1.CreateControl(selfcontrol:TSelfcontrol;EdLeft,EdTop:Integer;Parent:TWinControl);
//var selfcontrol: Tmyselfcontrol;//系统提示:Constant or type identifier expected
begin
selfcontrol := Tselfcontrol.Create(self);
selfcontrol.Top := EdTop;
selfcontrol.Left := EdLeft;
if Parent <> nil then
selfcontrol.Parent := Parent
else
selfcontrol.Parent := self;
selfcontrol.Show;
end;