Board index » delphi » TListView getting all selected items.

TListView getting all selected items.

There got to be a better way than iterating through all the items to find
those selected isn't there?
 

Re:TListView getting all selected items.


"Shannon Broskie" <shannonbros...@tagfolio.com> wrote in
news:3d04f4ce_2@dnews:

Quote
> There got to be a better way than iterating through all the
> items to find those selected isn't there?

(untested)

var
  Item: TListItem
begin
Item := TListItem.Create(nil);
with MyListView do
begin
  Item := Selected;
  while Item <> nil do
  begin
    ....do something with the retrieved item
    Item := GetNextItem( Item,sdAll,[isSelected] );
  end;
end;
end;

--
Alvin Lee
alvin...@attbi.com

Other Threads