Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Problem with treeview drag and drop

Problem with treeview drag and drop

Scheduled Pinned Locked Moved Visual Basic
helpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mo1492
    wrote on last edited by
    #1

    I have a TreeView control within the main form. The main form processes the normal drag/drop event processing. The drag/drop operation performs successfully except for this little problem. When I do a DoDragDrop() operation within the TreeView, when dragging the mouse 'within' the TreeView, the main form receives drag drop events. I only want the 'main form' events when the mouse is within the main form client area. What have I missed? Thanks Private Sub FolderTree_Drag(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles MyBase.ItemDrag If e.Button = Windows.Forms.MouseButtons.Left Then Dim node As TreeNode = CType(e.Item, TreeNode) Dim dataObject As New DataObject() Dim sFiles As New StringCollection sFiles.Add(node.FullPath) dataObject.SetData(ConstDragDropFormat, sFiles) ' Invoke the drag and drop operation DoDragDrop(dataObject, DragDropEffects.Copy) End If End Sub I have tried this code in the TreeView but it does not help. Private Sub TreeView_DragEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles MyBase.DragEnter e.Effect = DragDropEffects.None End Sub Private Sub TreeView_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles MyBase.DragDrop e.Effect = DragDropEffects.None End Sub Private Sub TreeView_DragOver(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles MyBase.DragOver e.Effect = DragDropEffects.None End Sub

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups