TrackBar自动循环滚动解决方案

TrackBar自动循环滚动
TrackBar自动循环滚动解决方案
如图所示
------解决方案--------------------
var bo:Boolean;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  with TrackBar1 do
  begin
    bo:=(Position<>Max) and ((Position=0) or (bo));

    if bo then
       Position:=Position+1
    else
       Position:=Position-1;
  end;
end;

快慢自己调Timer1.Interval

------解决方案--------------------
试过了吗,我是测试过成功的,才贴的代码
------解决方案--------------------
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  with TrackBar1 do
    if Tag = 0 then
      if Position = Max then
      begin
        Position := Position - 1;
        Tag := 1
      end else
        Position := Position + 1
    else
      if Position = Min then
      begin
        Position := Position + 1;
        Tag := 0
      end else
        Position := Position - 1
end;

------解决方案--------------------
直接用gif图不行吗?