send:
private void treeView1_DragEnter(object sender, DragEventArgs e)
{
TreeNode MoveItem = e.Data.GetData(typeof(TreeNode)) as TreeNode;
if (MoveItem.Nodes.Count <= 0)
{
e.Effect = DragDropEffects.Move;
textBox1.AllowDrop = true;
}
else
{
e.Effect = DragDropEffects.None;
textBox1.AllowDrop = false;
}
}
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
{
DoDragDrop(e.Item, DragDropEffects.Move);
}
rec:
private void textBox1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
}
private void textBox1_DragDrop(object sender, DragEventArgs e)
{
TreeNode MoveItem = e.Data.GetData(typeof(TreeNode)) as TreeNode;
textBox1.Text += MoveItem.Text+"-----";
}