Delphi XE2 listview artifacts

2020-02-01 18:46发布

问题:

I am using listview in vsreport virtual mode, have two columns and after I populate the list, select one row, and then select some other row there's an artifact left on a previously selected row, see image below. How to fix this?

and this is my code that gets the data from an array

procedure TForm1.ListView1Data(Sender: TObject; Item: TListItem);
begin
  Item.Caption := FloatToStr(Item.Index + 1);
  Item.SubItems.Add(FloatToStr(a[Item.Index]));
end;

When I hover the mouse, the artifacts dissapear. Thanks

回答1:

Setting the listview's DoubleBuffered property to true solves the artifacts problem.