Autor Beitrag
Hendi48
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mi 05.09.07 15:57 
Hi,
ich habe mal wieder eine Frage zu ListView's: Wie kann ich mehrere Items gleichzeitig löschen? Ich habe MultiSelect Enabled, aber ich weiß nicht wie ich mehrere Items löschen kann.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 05.09.07 16:04 
Mit der Eigenschaft Selected und der Funktion GetNextItem.

Hier das Beispiel aus der Delphi-Hilfe welches du dann noch überarbeiten (das Löschen der Items) musst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
var
  Item: TListItem;
begin
  Item := ListView1.Selected;
  while Item <> nil do
  begin
    ListBox1.Items.Add(Item.Caption);
    Item := ListView1.GetNextItem(Item, sdAll, [isSelected]);
  end;
end;


Gruß
Tino
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mi 05.09.07 16:51 
Danke, funktioniert super! :D