CodePudding user response:
ListBox1. The Items is StringList type, we can through the ListBox1. Items. The Strings [I] access all valuesSearch
S:=Edit1. Text;
For I:=0 to ListBox1. Items. Do the Count - 1
The begin
If S=ListBox1. Items. Strings [I] then//find the specified item
The begin
ListBox1. ItemIndex:=I;
exit;
end;
end;