So is the Left-Mouse click, but now you want to use it for two different operations. Plus, for me, the ListView functions exactly the same as the Treeview. This is the code I usedBruce, right-mouse click is already reserved for doing something else.........
VB Code:
Private Sub Form_Load() With ListView1 .View = lvwReport .ColumnHeaders.Add , , "Testing" .ListItems.Add , , "www.windmillsoftware.ca" .ListItems.Add , , "www.chinamouldings.com" .ListItems(1).Tag = .ListItems(1).Text .ListItems(2).Tag = .ListItems(2).Text .ColumnHeaders(1).Width = 4000 End With End Sub Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem) Debug.Print "Item Click" End Sub Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If (Button = vbLeftButton) Then ListView1.SelectedItem = ListView1.HitTest(X, Y) ListView1.Drag vbBeginDrag End If End Sub Private Sub WebBrowser1_DragDrop(Source As Control, X As Single, Y As Single) If Not (Source.SelectedItem Is Nothing) Then WebBrowser1.Navigate2 Source.SelectedItem.Tag End If End Sub
Whether it is a TreeView or ListView, the Node_Click and Item_Click events do not fire because of the Drag operation.




Reply With Quote