那在TGraphicControl上继承,重载Paint过程就可以了。
例:
unit graphicControl1;
interface
uses
Windows, Messages, SysUtils, Classes, Controls;
type
TGraphicControl1 = class(TGraphicControl)
private
{ Private declarations }
protected
protected
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('私人控件', [tgraphicControl1]);
end;
end.