5,386
社区成员
发帖
与我相关
我的任务
分享
type
TPanel = class(ExtCtrls.TPanel)
public
procedure Paint; override;
end;
TForm1 = class(TForm)
Panel1: TPanel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TPanel }
procedure TPanel.Paint;
begin
inherited;
Canvas.Pen.Color := clBlack;
Canvas.Rectangle(10, 10, 100, 100);
end;
procedure TWaitHint.Paint;
var
c: TCanvas;
vI: Integer;
begin
inherited;
c := TControlCanvas.Create;
try
TControlCanvas(c).Control := Self;
c.Brush.Style := bsClear;
c.Pen.Color := FBorderColor;
if FBorderWidth > 0 then
for vI := 1 to FBorderWidth do
c.Rectangle(vI - 1, vI - 1, Self.Width - vI + 1, Self.Height - vI + 1);
finally
c.Free;
end;
end;