添加项目
TreeView1.Items.Add(nil,'ABC');
删除选中的节点
TreeView1.Selected.Delete;
删除鼠标右键选中的节点
var
node1:TTreeNode;
procedure TForm1.TreeView1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
node1:=TreeView1.GetNodeAt(x,y);
end;
procedure TForm1.Deete1Click(Sender: TObject);
begin
TreeView1.Items.Delete(node1);
end;
node1:TTreeNode;
procedure TForm1.TreeView1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
node1:=TreeView1.GetNodeAt(x,y);
end;
procedure TForm1.Deete1Click(Sender: TObject);
begin
TreeView1.Items.Delete(node1);
end;