Codeprivate void treeView1_DragDrop(object sender, DragEventArgs e) { //判断数据是否是 TreeNode 的格式 if (e.Data.GetDataPresent("System.Windows.Forms.TreeNode", false)) { TreeNode dragedTreeNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode"); //获取鼠标落点处 TreeNode Point pt = ((TreeView)sender).PointToClient(new Point(e.X, e.Y)); TreeNode targetTreeNode = ((TreeView)sender).GetNodeAt(pt); targetTreeNode.Nodes.Add(dragedTreeNode.Clone() as TreeNode); dragedTreeNode.Remove(); (sender as TreeView).ExpandAll(); } else { MessageBox.Show("不是有效的树节点!"); } }