I have a Delphi project that consists of two forms namely MainForm and DialogForm. When I click on Button1, the DialogForm should appear and stay on top until a process complete (the process takes a few seconds to complete).
The DialogForm includes a Timage component. When I click on the Button1 to show the DialogForm, the Gif image appears but without animation. This happens only when the process starts (without the process the animation works). What is the reason for this and how to keep the animation until closing the DialogForm?
procedure TMainForm.Button1Click(Sender: TObject);
var
gif: TGIFImage;
begin
Enabled:=false;
try
DialogForm.Show;
DialogForm.Refresh;
// The process is:
...
ipcAES1.Encrypt;//where ipcAES is part of the IPWorks Encrypt library
RichEdit1.Text:=ipcAES1.OutputMessage;
finally
Enabled:= true;
DialogForm.Close;
end;
end;
//---------------------------------------
procedure TDialogForm.FormShow(Sender: TObject);
var
gif: TGIFImage;
begin
gif := TGIFImage.Create;
gif.LoadFromFile('D:\preview.gif');
gif.Animate := True;
image1.Parent := Self;
image1.Left := 0;
image1.Top := 0;
image1.width := 800;
image1.height := 800;
image1.Picture.Assign(gif);
gif.Animate := True;
gif.Free;
end;