Registriert seit: 27. Apr 2005
Ort: Görlitz
1.358 Beiträge
Delphi XE2 Professional
|
Re: Listview von doppelten Einträgen befreien.
26. Okt 2005, 06:50
Probiers mal damit:
Delphi-Quellcode:
procedure TForm4.Doppelkiller(LV: TListview);
var
slItems : TStrings;
idx : Integer;
begin
if (not Assigned(LV)) then
exit;
try
slItems:=TStringList.Create;
Lv.Items.BeginUpdate;
for idx:=LV.Items.Count-1 downto 0 do
begin
if (slItems.IndexOf(LV.Items.Item[idx].Caption)=-1) then
slItems.Add(LV.Items.Item[idx].Caption)
else
LV.Items.Delete(idx);
end;
Lv.Items.EndUpdate;
finally
slItems.Free;
end;
end;
Benjamin Schwarze If I have seen further it is by standing on the shoulders of Giants. (Isaac Newton)
|