unit colorProgressBar;
interface
uses
Classes, ComCtrls, Graphics, Controls, Windows;
type
TcolorProgressBar = class(TprogressBar)
private
{ Private declarations }
Fcolor:Tcolor;
procedure SetColor(Value: TColor);
protected
{ Protected declarations }
public
{ Public declarations }
procedure SetParent(AParent: TWinControl); override;
published
{ Published declarations }
property Color: TColor read FColor write SetColor default clblue;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('KaguoVCL', [TcolorProgressBar]);
end;
{ TcolorProgressBar }
procedure TcolorProgressBar.SetColor(Value: TColor);
begin
if FColor <> Value then
begin
FColor := Value;
if self.Parent<>nil then
postMessage(self.Handle, $0409, 0, Fcolor);
end;
end;
procedure TcolorProgressBar.SetParent(AParent: TWinControl);
begin
inherited;
if AParent<>nil then
postMessage(self.Handle, $0409, 0, Fcolor);
end;
end.