TAnimateActive (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

To run this example, create a new project, place a button on the form, and insert the example code to the button-click event. Place the button on the bottom of the form to leave room for the TAnimate component that will be created on the fly.

Code

procedure TForm1.Button1Click(Sender: TObject);
var
  TempForm: TForm;
  I: Integer;
begin
  TempForm := TForm.Create(Self);
  with TAnimate.Create(TempForm) do
  try
    Parent := TempForm;
    CommonAVI := aviFindFile;
    Active := True;
    TempForm.Show;
    // Simulate a lengthy process. Alter this value
    // to accommodate your machine speed.
    for I := 0 to 90000000 do Application.ProcessMessages;
  finally
    TempForm.Release;
  end;
end;

Uses