ListView and AniIndicator

0

If someone can give a 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 from the database on demand. I would like the AniIndicator to run while loading the records, but AniIdicator stops running when I load new records in the ListView, I already tried to do with Thread but I could not. If someone has a light.

    
asked by anonymous 30.01.2018 / 15:05

1 answer

0

I made the code below test and everything worked fine, try to use procedure Application.ProcessMessages during loop of data loading in 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;
    
30.01.2018 / 17:58