我想用delphi做一个汉诺塔演示程序
想用TShape来做
但是我声明一个shape:
var
bar:TShape;
begin
bar.Create;
bar.shape:=stRectangle;
bar.left:=100;
bar.top:=200;
end
怎么没有见到shape出现?
想用TShape来做
但是我声明一个shape:
var
bar:TShape;
begin
bar.Create;
bar.shape:=stRectangle;
bar.left:=100;
bar.top:=200;
end
怎么没有见到shape出现?
改为
bar:=TShape.create;
bar:TShape;
begin
bar:=TShape.Create(self);//构造函数是这样用的....
bar.Parent:=self;//必须要设置拥有者
bar.Width:=100;
bar.Height:=100;
bar.Top:=100;//位置也要设置
bar.Left:=100;
bar.Visible:=true;//不让它显示它是不会出来地......
end;
var
bar:TShape;
begin
bar:=TShape.Create(self);
bar.Parent:=self; //必须要设置拥有者
bar.shape:=stRectangle;
bar.left:=100;
bar.top:=200;
end;