T
terry_zhou82
Unregistered / Unconfirmed
GUEST, unregistred user!
过程代码如下:
procedure change(var x:Tcomponent);
begin
form1.repaint;
form1.Canvas.pen.color:=clblue;
form1.Canvas.pen.width:=3;
form1.Canvas.polyline([point(speedbutton1.left,speedbutton1.top),
point(speedbutton1.left+speedbutton1.width,speedbutton1.top),
point(speedbutton1.left+speedbutton1.width,speedbutton1.top+speedbutton1.height),
point(speedbutton1.left,speedbutton1.top+speedbutton1.height),
point(speedbutton1.left,speedbutton1.top)]);
end;
我想把上面的这段改写成过程,是不是把里面的SPEEDBUTTON1改成X?
如果调用的话,我用
Procedure button1.onclick(sender:Tobject);
begin
change(button2);//如果我要用BUTTON2也实现这个功能
end;
对不对,好像老是报错啊,望各位大哥多多指点小弟,谢谢!
procedure change(var x:Tcomponent);
begin
form1.repaint;
form1.Canvas.pen.color:=clblue;
form1.Canvas.pen.width:=3;
form1.Canvas.polyline([point(speedbutton1.left,speedbutton1.top),
point(speedbutton1.left+speedbutton1.width,speedbutton1.top),
point(speedbutton1.left+speedbutton1.width,speedbutton1.top+speedbutton1.height),
point(speedbutton1.left,speedbutton1.top+speedbutton1.height),
point(speedbutton1.left,speedbutton1.top)]);
end;
我想把上面的这段改写成过程,是不是把里面的SPEEDBUTTON1改成X?
如果调用的话,我用
Procedure button1.onclick(sender:Tobject);
begin
change(button2);//如果我要用BUTTON2也实现这个功能
end;
对不对,好像老是报错啊,望各位大哥多多指点小弟,谢谢!