直接肯定是不行了(没完成EDIT过程就想删除NODE?应该在完成后删除)。不过可以变通一下
var
Form1: TForm1;
ANode:TTreeNode; //用于存当前NODE,如果你的提交过程慢,应该设个动态NODE数组
implementation
{$R *.DFM}
procedure TForm1.TreeView1Edited(Sender: TObject; Node: TTreeNode;
var S: String);
begin
ANode:=Node;
end;
procedure TForm1.TreeView1GetSelectedIndex(Sender: TObject;
Node: TTreeNode);
begin
if ANode<>nil then
ANode.Delete;
end;