title: .NET 2015 winforms: drag a treenode to desktop?
body: <p>Plenty of stuff on the web about dragging between treenodes and other controls, but I have a treeview that contains lists of documents, and I can't drag anywhere outside of my main form. </p>
  
  <p>I'm already allowing it to drop between nodes, and onto a ListView control. However, if I drag the node off my window, the cursor changes to the "nuh-uh!" image. </p>
  
  <p>The ListView allows me to drop SelectedItems onto the desktop or Windows Explorer. The TreeView doesn't.</p>
  
  <p>I noticed that ListViewItems have the property "FileLocation". I'm wondering if Windows isn't picking that up to know how to handle a drop onto Explorer?</p>
  
  <p>So, I need to be able to preserve the ability to drag between nodes, between TreeView and ListView, AND onto the desktop or File Explorer. </p>
  
  <p>This is the current code I'm using to do the dragdrop with the TreeView. Thanks for any suggestions:</p>
  
  <pre><code>    Private Sub tvAllDocuments_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles tvAllDocuments.ItemDrag
          If tvAllDocuments.SelectedNodes.Count &gt; 0 Then
  
              For Each mySelectedNode As TreeNode In tvAllDocuments.SelectedNodes
                  If mySelectedNode IsNot Nothing AndAlso mySelectedNode.Tag IsNot Nothing AndAlso mySelectedNode.Text.Substring(0, 1) &lt;&gt; "*" Then
                      tvAllDocuments.DoDragDrop(mySelectedNode, DragDropEffects.Move)
                  End If
              Next
          End If
      End Sub
  </code></pre>