Hm, also bei mir tut es eigentlich folgendes:
Delphi-Quellcode:
implementation uses System.Generics.Collections;
{$R *.dfm}
procedure TForm20.Button1Click(Sender: TObject);
var
treeNode: TTreeNode;
selectedNodes: TObjectList<TTreeNode>;
begin
selectedNodes := TObjectList<TTreeNode>.Create(False);
try
for treeNode in TreeView1.Items do
if treeNode.Selected then
selectedNodes.Add(treeNode);
for treeNode in selectedNodes do
TreeView1.Items.Delete(treeNode);
finally
selectedNodes.Free();
end;
end;
Oder habe ich die Frage falsch verstanden?