procedure TForm1.BitBtn4Click(Sender: TObject);
var
i, s: Integer;
found: Boolean;
begin
if ListView1.Items.Count = 0 then
exit;
found := False;
ListView1.MultiSelect := False;
ListView1.HideSelection := False;
s := 0;
if Assigned(ListView1.Selected) then
s := ListView1.Selected.Index;
if s < ListView1.Items.Count - 1 then
i := s + 1
else
i := 0;
while not found do
begin
if pos(Edit5.Text, ListView1.Items[i].Caption) > 0 then
begin
ListView1.Items[i].Selected := True;
found := True;
break;
end
else
begin
if i = s then
break
else if i < ListView1.Items.Count - 1 then
Inc(i)
else
i := 0;
end;
end;
if not found then
ShowMessage('Not found');