ProgressBar control of progress color (ColorProgressBar)

xiaoxiao2021-03-06  38

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 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 dam fcolor: = value; if self.parent <> NIL THEN PostMessage (Self.handle, $ 0409, 0, Fcolor); End;

Procedure TcolorProgressBar.SetParent (Aparent: TwinControl); Begin Inherited; if Aparent <> NIL THEN PostMessage (Self.handle, $ 0409, 0, Fcolor);

End.

转载请注明原文地址:https://www.9cbs.com/read-118313.html

New Post(0)