In a WebBrowser project, a TreeView is used to list the History of the URLs a user has visited. Other than left-clicking any node in the TreeView to navigate to the URLs, users can also navigate by dragging & dropping a node in the WebBrowser. This is how I am implementing it:The above code implements the drag-drop feature exactly as I want it but strangely, the WebBrowser doesn't navigate to the Tag of the node (which is the URL) when a node is just left-clicked.VB Code:
Private Sub TreeView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) If (Button = vbLeftButton) Then TreeView1.SelectedItem = TreeView1.HitTest(x, y) TreeView1.Drag vbBeginDrag End If End Sub Private Sub wWeb_DragDrop(Source As Control, x As Single, y As Single) If Not (Source.SelectedItem Is Nothing) Then wWeb.Navigate2 Source.SelectedItem.Tag End If End Sub
What am I missing here?




ARPAN
Reply With Quote