Results 1 to 3 of 3

Thread: [RESOLVED] drag treeview nodes to picture boxes

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2012
    Posts
    142

    Resolved [RESOLVED] drag treeview nodes to picture boxes

    Hello,
    I need to drag a tv node to a pic box, I got this code:
    Code:
    Private Sub Inv_ItemDrag(sender As System.Object, e As System.Windows.Forms.ItemDragEventArgs) Handles Inv.ItemDrag
            If e.Button = MouseButtons.Left Then
                Inv.SelectedNode.Tag = PictureBox1.Image
                DoDragDrop(e.Item, DragDropEffects.Copy)
    
            End If
    
        End Sub
    
        Private Sub PictureBox2_DragDrop(sender As System.Object, e As System.Windows.Forms.DragEventArgs) Handles PictureBox2.DragDrop
            AllowDrop = True
            PictureBox2.Image = Inv.SelectedNode.Tag
        End Sub
    I want the picturebox2 image to change to picturebox1 image when a node is dropped there.

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: drag treeview nodes to picture boxes

    I already posted a working, adaptable project in your other thread: http://www.vbforums.com/showthread.php?t=670684

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2012
    Posts
    142

    Re: drag treeview nodes to picture boxes

    oh, I didn't see that. Thank you very much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width