Integer最大数的限制.估计你用不完.
每查一条数据就重画一次,你的时间主要花在重画上面了.
用下面的方式就快多了.
var
I : Integer;
begin
ListBox1.Items.begin
Update;
try
for I := 0 to 60000do
ListBox1.Items.Add(IntToStr(I));
finally
ListBox1.Items.EndUpdate;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FillMemSL;
var
i: Integer;
begin
FMemSL.Clear;
for i := 0 to 59999do
FMemSL.Add(IntToStr(i));
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
FMemSL := TStringList.Create;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FMemSL.Free;
end;
procedure TForm1.ListBox1Data(Control: TWinControl;
Index: Integer;
var Data: String);
begin
Data := FMemSL.Strings[Index];
end;