Listview and Aniindicator

Asked

Viewed 117 times

0

If anyone can help, I have the following problem : I have two components in a form, a Listview and an Aniindicator, I am loading the Listview data into blocks coming from the database as per demand. I would like Aniindicator to run while loading the records, but Aniindicator stops running when I load new records in Listview, I tried with Thread but could not. If anyone has a light.

  • already have something programmed? Shows us how it is loading the data.

1 answer

0

I made the code below test and everything worked out, try to use the procedure Application.ProcessMessages during the loop of data loading in the TListView

Follows:

procedure TesteAniIndicator;
var
  I: Integer;
begin
  AniIndicator1.Visible := True;
  AniIndicator1.Enabled := True;
  try
    for I := 0 to 1000 do
    begin
      Sleep(10);
      Application.ProcessMessages;
    end;
  finally
    AniIndicator1.Enabled := False;
    AniIndicator1.Visible := False;
  end;
end;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.