Nodes only understand .Add and .Remove
You would have to take the currently selected node...
.Remove it from the node it belongs to, and
.Add it to the node you want it on
Here is how I determine a node based on mouse arguments so I can do a right-click which treeview's don't support in their events.
- private void treeView1_MouseDown(object sender, MouseEventArgs e)
-
{
-
if (e.Button == MouseButtons.Right)
-
{
-
TreeNode selectedNode = treeView1.GetNodeAt(e.X, e.Y);
-
//MessageBox.Show("You clicked on node: " + selectedNode.Text);
-
}
-
//else we ignore it for convenience
-
}
-
}
-
You should be able to tear this apart to work out the node selected at mouse down, and again at mouse up