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;
热爱工作,热爱生活,热爱文学