不会吧,我测试可以的。代码全部给你:unit:--------------unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls, TeEngine, Series, TeeProcs, Chart, AppEvnts, DB, DBClient, TeeFunci, typinfo, ADODB;type TForm1 = class(TForm) ListBox1: TListBox
ListBox2: TListBox
Button2: TButton
Button3: TButton
procedure Button2Click(Sender: TObject)
procedure Button3Click(Sender: TObject)
private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button2Click(Sender: TObject);const MAXVALUE = 99999;var Index, iRow: Integer
iTmp,I: Integer
procedure DoAdd
begin Listbox2.Items.Add(inttostr(Index))
end;begin iRow := 1
Index := 1
Listbox2.Items.BeginUpdate
try while (Index <= MAXVALUE) and (iRow <= Listbox1.Count) do begin iTmp := StrToInt(Listbox1.Items[iRow - 1])
if iTmp <> Index then begin DoAdd()
end else Inc(iRow)
Inc(Index)
end
while (Index <= MAXVALUE) do begin DoAdd
Inc(Index)
end
finally Listbox2.Items.EndUpdate
end;end;procedure TForm1.Button3Click(Sender: TObject);var I: Integer;begin Listbox1.Clear
Listbox2.Clear
Listbox1.Items.BeginUpdate
for I := 1 to 40000 do Listbox1.Items.Add(inttostr(i * 2))
Listbox1.Items.EndUpdate;end;end.---------------------dfm:-------------object Form1: TForm1 Left = 268 Top = 273 Width = 675 Height = 392 Caption = 'Form1' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object ListBox1: TListBox Left = 40 Top = 24 Width = 129 Height = 177 ItemHeight = 13 Items.Strings = ( '00003' '00005' '00006') TabOrder = 0 end object ListBox2: TListBox Left = 320 Top = 8 Width = 129 Height = 153 ItemHeight = 13 TabOrder = 1 end object Button2: TButton Left = 216 Top = 40 Width = 75 Height = 25 Caption = 'Button2' TabOrder = 2 OnClick = Button2Click end object Button3: TButton Left = 216 Top = 152 Width = 75 Height = 25 Caption = 'Button3' TabOrder = 3 OnClick = Button3Click endend