这个问题以前出现过好多次了
把COMSTR分别存入ListBox
procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
i,oldlen:integer;
begin
if key in [8,37..40] then exit;
for i:=0 to listbox1.Items.Count-1 do
begin
if pos(edit1.text,listbox1.Items)=1 then
begin
oldlen:=length(edit1.text);
edit1.Text:=listbox1.items;