D
ddzhouqian
Unregistered / Unconfirmed
GUEST, unregistred user!
实现代码如下:但看起来会显得左,上边框和右,下边框的宽度不一样,不知道什么原因?
var c:TCanvas;
begin
try
c:=TControlCanvas.Create;
TControlCanvas(c).Control := panel1;
c.Pen.Width:=2;
c.Pen.Color:=clgreen;
c.MoveTo(9,9);
c.LineTo(panel2.Width+20,10);
c.LineTo(panel2.Width+20,panel2.Height+20);
c.LineTo(10,panel2.Height+20);
c.LineTo(10,10);
finally
c.Free;
end;
var c:TCanvas;
begin
try
c:=TControlCanvas.Create;
TControlCanvas(c).Control := panel1;
c.Pen.Width:=2;
c.Pen.Color:=clgreen;
c.MoveTo(9,9);
c.LineTo(panel2.Width+20,10);
c.LineTo(panel2.Width+20,panel2.Height+20);
c.LineTo(10,panel2.Height+20);
c.LineTo(10,10);
finally
c.Free;
end;