Results 1 to 2 of 2

Thread: treeview double click problem

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    39

    Resolved treeview double click problem

    Hello Guys,

    I'm having a hard time with this and maybe you can help me, I have a treeview in my form, showing node documents, when you double click the node, the document open in another form, everything was working perfectly using this code:

    Code:
     Private Sub trvExplorer_NodeMouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles trvExplorer.NodeMouseDoubleClick
     
    Dim strNodeTag As String = e.Node.Tag
    
    If e.Node.Tag.ToString.StartsWith("ART|") Then
    
    'here I open the document viewer
    End If
    Everything was great until I implement drag and drop to order the documents in different folders inside the tree, seems the problem start because I need to call the MouseDown event to start the drag and drop process like this:

    Code:
     
    Private Sub trvExplorer_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles trvExplorer.MouseDown
    
                Dim tree As TreeView = CType(sender, TreeView)
    
                Dim node As TreeNode
                node = tree.GetNodeAt(e.X, e.Y)
                tree.SelectedNode = node
    ' this next line cause the problem
    tree.DoDragDrop(node.Clone, DragDropEffects.Copy)
    The drag and drop is working perfect, but now I can't open the document by double clicking, acctually is working doing a 3 quicks clicks LOL

    Any idea or workaround to solve this problem?

    Thanks a lot!

    Diego

  2. #2

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    39

    Re: treeview double click problem

    any ideas?

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