I used the following to delete items:
with ItemTree.Items do
begin
for i := Pred(Count) downto 0 do
begin
if Item[i].Checked then
begin
Continue;
end;
if Item[i].Selected then
begin
DeleteTimeData(Item[i]);
Delete(Item[i]);
end;
end;
end;
This works as long as the last item is not included. Why?
Because after deleting the last item, the new last item becomes automatically selected.
If the last item is not included, then no item becomes automatically selected, so this is an anomaly that may need to be corrected.
Raymond.
Comments