unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  WOwnrScrllBar, StdCtrls;

type
  TForm1 = class(TForm)
    g: TWOwnrScrllBar;
    Label1: TLabel;
    procedure gTopDraw(Sender: TObject; Rect: TRect;
      State: Boolean);
    procedure gTrackDraw(Sender: TObject; Rect: TRect; State: Boolean);
    procedure gBottomDraw(Sender: TObject; Rect: TRect; State: Boolean);
    procedure gChange(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.gTopDraw(Sender: TObject; Rect: TRect;
  State: Boolean);
begin
if state = true then
g.canvas.Brush.Color := clGreen
else
g.canvas.Brush.Color := clBlack;

g.Canvas.FillRect(rect);
end;

procedure TForm1.gTrackDraw(Sender: TObject; Rect: TRect; State: Boolean);
begin
g.canvas.Brush.Color := clred;
g.Canvas.FillRect(rect);
end;

procedure TForm1.gBottomDraw(Sender: TObject; Rect: TRect; State: Boolean);
begin
if state = true then
g.canvas.Brush.Color := clGreen
else
g.canvas.Brush.Color := clBlack;
g.Canvas.FillRect(rect);
end;

procedure TForm1.gChange(Sender: TObject);
begin
label1.Caption := inttostr(g.position);
end;

end.
