En mi caso no experimento parpadeo con el siguiente codigo:
Código Delphi
[-]
unit Unit1;
interface
uses
System.Classes, Vcl.Forms, Vcl.Controls, Vcl.ExtCtrls, Vcl.StdCtrls,
Vcl.ComCtrls;
type
TForm1 = class(TForm)
ListView1: TListView;
btnPopulate: TButton;
btnPopulateBeginUpdate: TButton;
Panel1: TPanel;
procedure FormCreate(Sender: TObject);
procedure btnPopulateClick(Sender: TObject);
procedure btnPopulateBeginUpdateClick(Sender: TObject);
private
procedure PopulateListView;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
System.SysUtils,
System.Diagnostics,
Vcl.Themes, Vcl.Styles;
procedure TForm1.FormCreate(Sender: TObject);
begin
TStyleManager.TrySetStyle('Vapor');
ListView1.ViewStyle := TViewStyle.vsReport;
ListView1.Columns.Add.Caption := 'Columna 1';
ListView1.Columns.Add.Caption := 'Columna 2';
ListView1.Columns.Add.Caption := 'Columna 3';
end;
procedure TForm1.PopulateListView;
var
I: Integer;
Value: string;
ListItem: TListItem;
sw: TStopwatch;
begin
sw := TStopwatch.StartNew;
ListView1.Clear;
for I := 0 to 10000 do
begin
ListItem := ListView1.Items.Add;
Value := IntToStr(I);
ListItem.Caption := 'Item # ' + Value;
ListItem.SubItems.Add('SubItem # ' + Value);
ListItem.SubItems.Add('SubItem # ' + Value);
ListItem.SubItems.Add('SubItem # ' + Value);
end;
sw.Stop;
Caption := Format('Demoro: %d ms', [sw.ElapsedMilliseconds]);
end;
procedure TForm1.btnPopulateBeginUpdateClick(Sender: TObject);
begin
ListView1.Items.BeginUpdate;
try
PopulateListView;
finally
ListView1.Items.EndUpdate;
end;
end;
procedure TForm1.btnPopulateClick(Sender: TObject);
begin
PopulateListView;
end;
end.
Que Style estas usando? Cuantos items estas agregando?