在button的单击事件里:
with paintbox1 do
begin
canvas.MoveTo(left+width,top);
canvas.LineTo(left+width,top+height);
canvas.MoveTo(left,top+height);
canvas.LineTo(left+width,top+height);
end;运行单击button,在paintbox上并没有出现相应的图线
请大虾们帮忙看看为什么会这样
with paintbox1 do
begin
canvas.MoveTo(left+width,top);
canvas.LineTo(left+width,top+height);
canvas.MoveTo(left,top+height);
canvas.LineTo(left+width,top+height);
end;运行单击button,在paintbox上并没有出现相应的图线
请大虾们帮忙看看为什么会这样
begin
canvas.MoveTo(left,top);
canvas.LineTo(left,top+height);
canvas.MoveTo(left,top);
canvas.LineTo(left+width,top);
end;
Canvas.pen.width:=......
begin
with Self.PaintBox1 do
begin
Canvas.Pen.Color := clRed;
Canvas.Pen.Width := 5;
canvas.MoveTo(width, 0);
canvas.LineTo(width, height);
canvas.MoveTo(0, height);
canvas.LineTo(width, height);
end;
end;你的已经越界了