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
Re: treeview double click problem