{繪制圓角矩形; 最後兩個參數是設置圓角的}procedure TForm1.Button3Click(Sender: TObject);
begin
btn := TButton(Sender);
Canvas.RoundRect(btn.Left, y1, btn.Left+btn.Width, y2, 20,20);
end;
{繪制焦點矩形; 它不受畫筆的影響; 它的顏色是和畫刷的顏色進行某種運算得來的}procedure TForm1.Button4Click(Sender: TObject);
var
R: TRect;
begin
btn := TButton(Sender);
R := Rect(btn.Left, y1, btn.Left+btn.Width, y2);
Canvas.DrawFocusRect(R);
end;
{矩形描邊, 用的不是畫筆是畫刷}procedure TForm1.Button5Click(Sender: TObject);
var
R: TRect;
begin
btn := TButton(Sender);
R := Rect(btn.Left, y1, btn.Left+btn.Width, y2);
Canvas.FrameRect(R);
end;
end.
//效果圖: