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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
chengjianCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
karen021897Author Commented:
Excelent

Karen
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.