procedure TForm1.FormPaint(Sender: TObject);
var
i,j : Integer;
Dct : TRect;
begin
j := ToolBar1.Height;
for i:=0 to (ToolBar1.Width - 1) div 2 do
begin
ToolBar1.Canvas.Brush.Color := RGB(255, 255, Trunc(2*255*i/ToolBar1.Width));
Dct := Rect(ToolBar1.Left + i*2,
ToolBar1.Top + 1,
ToolBar1.Left + (i+1)*2,
ToolBar1.Top + 1 + ToolBar1.Height - 2);
ToolBar1.Canvas.FillRect(Dct);
end;
end;