listview - multivalues - delete all


hello good expert,

alright.......... i know how to set multivalue to true. But i need code to delete all i select in multivalues in listview

regards
Karen
karen021897Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
chengjianConnect With a Mentor Commented:
i think this is enough
r := lv.items.count - 1
for i:= r downto 0 do
begin
 if lv.items[i].selected then
    lv.items[i].delete;
end;
0
 
ckanetaCommented:
Here is some code:

procedure TForm1.SpeedButton2Click(Sender: TObject);
var c,s:integer; iarr:array[1..10]of integer;
 begin
  memo1.lines.clear; s:=0;
  for c:= 1 to lv.Items.Count do
   if lv.Items[c-1].Selected then begin
    memo1.lines.add(lv.items[c-1].Caption);
    s:=s+1; iarr[s]:=c-1;
   end;
  for c:=s downto 1 do lv.Items[iarr[c]].delete;
 end;

it deletes everything that is selected
in the Listview(lv)
0
 
ckanetaCommented:
you might be able to lose the array and set the first for loop from count downto 1, but i didn't try that
0
 
karen021897Author Commented:
Excelent

Karen
0
All Courses

From novice to tech pro — start learning today.