Delphi ListView 按标题删除项目,这段代码的遍历是从后往前遍历的
for i:=ListView1.Items.Count-1 downto 0 Do if ListView1.Items[i].Caption = Edit1.Text then begin ListView1.Items.Item[i].Delete(); //删除当前选中行 end;
Delphi ListView 按标题删除项目,这段代码的遍历是从后往前遍历的
for i:=ListView1.Items.Count-1 downto 0 Do if ListView1.Items[i].Caption = Edit1.Text then begin ListView1.Items.Item[i].Delete(); //删除当前选中行 end;