1

I am looking at using the AnimateWindow method (which just calls the underlying WinAPI call), whilst using a VCL style in Delphi Tokyo. The code looks like this (actually taken from another Stack Overflow question).

procedure TForm4.Button1Click(Sender: TObject);
begin
if  hidden = False then
begin
  AnimateWindow(Panel1.Handle, 256, AW_SLIDE or AW_HOR_NEGATIVE or AW_HIDE);
  hidden := True;
end
else
begin
  AnimateWindow(Panel1.Handle, 256, AW_SLIDE or AW_HOR_POSITIVE or AW_ACTIVATE);
  hidden := False;
end;

end;

The animation works, however it looks terrible - it is jerky and draws white artifacts on the panel edges whilst it animates. It is not just the graphics on my PC, but looks like a more general problem. Turning off style completely makes the operation render properly, but that is not what I want in the end.

Will this approach not work for applications that using VCL Styles?

mmmm
  • 2,431
  • 2
  • 35
  • 56

0 Answers0