G
Guest
Hello NG,
I try to use drag and drop function between two list views. For this I found
following code:
http://msdn.microsoft.com/library/d.../en-us/dv_vstechart/html/vbtchimpdragdrop.asp
It works fine, but I have another problem. I want to create functionality
like a Windows Explorer. This means, if I select some items from list view No
1 and drag&drop this to the list view No 2, then I want to mark automatically
the item from list view No 2 under the mouse cursor (this would be like same
as if you want to copy some files to a directory in Windows Explorer. The
actually directory under mouse will be marked).
For check this event I use following function:
Private Sub ListView_DragOver(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles MyListView.DragOver
…
…
End Sub
And for get the actually item index, I use this method:
Me. MyListView.GetItemAt(e.X, e.Y).Index
So I can mark the Item under my cursor by drag&drop.
It would be good, but the event arguments e.X and e.Y returns the global
mouse position!!! So I cannot use this, because I need the relative cursor
position to the list view!
How can I get the actually list view mouse position used Drag.Over event?
Thanks
simon
I try to use drag and drop function between two list views. For this I found
following code:
http://msdn.microsoft.com/library/d.../en-us/dv_vstechart/html/vbtchimpdragdrop.asp
It works fine, but I have another problem. I want to create functionality
like a Windows Explorer. This means, if I select some items from list view No
1 and drag&drop this to the list view No 2, then I want to mark automatically
the item from list view No 2 under the mouse cursor (this would be like same
as if you want to copy some files to a directory in Windows Explorer. The
actually directory under mouse will be marked).
For check this event I use following function:
Private Sub ListView_DragOver(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles MyListView.DragOver
…
…
End Sub
And for get the actually item index, I use this method:
Me. MyListView.GetItemAt(e.X, e.Y).Index
So I can mark the Item under my cursor by drag&drop.
It would be good, but the event arguments e.X and e.Y returns the global
mouse position!!! So I cannot use this, because I need the relative cursor
position to the list view!
How can I get the actually list view mouse position used Drag.Over event?
Thanks
simon