C
Co
Hi All,
I use following code to drag drop an item from a Listview onto a
Treeview but the code doesn't recognize the ListviewItem:
Public Sub TreeView_DragDrop( _
ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.DragEventArgs) _
Handles TreeView.DragDrop
If e.Data.GetDataPresent("System.Windows.Forms.ListViewItem",
False) Then
Dim pt As Point
Dim DestinationNode
pt = TreeView.PointToClient(New Point(e.X, e.Y))
DestinationNode = TreeView.GetNodeAt(pt)
MsgBox(DestinationNode.row("ID"))
End If
End Sub
The Listview displays files in every node in the Treeview.
When I want to drag a file from one node to another I just drag it
onto the new node and let go.
My DragDrop code however doesn't recognizes it as a ListviewItem:
If e.Data.GetDataPresent("System.Windows.Forms.ListViewItem",
False) Then
What am I doing wrong?
Regards
Marco
The Netherlands
I use following code to drag drop an item from a Listview onto a
Treeview but the code doesn't recognize the ListviewItem:
Public Sub TreeView_DragDrop( _
ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.DragEventArgs) _
Handles TreeView.DragDrop
If e.Data.GetDataPresent("System.Windows.Forms.ListViewItem",
False) Then
Dim pt As Point
Dim DestinationNode
pt = TreeView.PointToClient(New Point(e.X, e.Y))
DestinationNode = TreeView.GetNodeAt(pt)
MsgBox(DestinationNode.row("ID"))
End If
End Sub
The Listview displays files in every node in the Treeview.
When I want to drag a file from one node to another I just drag it
onto the new node and let go.
My DragDrop code however doesn't recognizes it as a ListviewItem:
If e.Data.GetDataPresent("System.Windows.Forms.ListViewItem",
False) Then
What am I doing wrong?
Regards
Marco
The Netherlands