Delphi 窗体抖动效果

procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
t: Integer;
l: Integer;
seed: Integer;
begin
t:=Self.Top;
l:=self.Left;
seed := 0;
for i:=0 to 15 do
begin
    Application.ProcessMessages;
    case seed of
    0: begin
         self.Top := t + 10;
         Self.Left := l + 10;
         seed := 1;
       end;
    1: begin
         self.Top := t - 10;
         Self.Left := l - 10;
         seed := 0;
       end;
    end;
    SleepEx(50,True);
end;
self.Top := t;
Self.Left := l;
end;

posted @ 2010-06-24 23:18  坚持Delphi  阅读(421)  评论(0编辑  收藏  举报