DELphi ListBox 条件删除的做法

TListBox的内容123456怎么做到发现 3的时候 然后删除只剩下 1和2即可
2025-03-01 12:31:54
推荐回答(1个)
回答1:

i:=0;
while i if ListBox1.Items[i]='3' then begin
while i ListBox1.Items.Delete(i);
break;
end;
Inc(i);
end;