procedure TForm1.Button1Click(Sender: TObject);
var
x: integer;
dwStyle: DWord;
begin
dwStyle := GetWindowLong(Button1.Handle, GWL_STYLE);
for x := 0 to 4 do begin
SetWindowLong(Button1.Handle, GWL_STYLE, dwStyle or BS_RIGHT);
Button1.refresh;
sleep(120);
SetWindowLong(Button1.Handle, GWL_STYLE, dwStyle or BS_LEFT);
Button1.refresh;
sleep(120);
end;
SetWindowLong(Button1.Handle, GWL_STYLE, dwStyle);
Button1.refresh;
end;