Click to See Complete Forum and Search --> : Drag-Drop
Yves Theys
May 27th, 1999, 06:39 AM
If you begin dragging a file in Windows Explorer, you see that a 'ghost image' of the file is attached to your mouse cursor when you move around. How can I pick up such a 'ghost image', from an item in a listview or from a node in a treeview?
Could someone help me out on this one?
See you,
Yves
Yves Theys
June 2nd, 1999, 02:54 AM
No need anymore, got it.
Ravi Kiran
June 2nd, 1999, 03:48 AM
Where?
how to do it, I also want to know..
Yves Theys
June 2nd, 1999, 05:12 AM
Here is some code that works fine in case an item is picked up (begin drag) in a ListView1 and dropped in a TreeView1
[vbcode]
Private Sub ListView1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim itmX As ListItem
If Button = 1 Then
Set itmX = ListView1.SelectedItem
End If
'itmX. Other operations ... not of importance
End Sub
Private Sub ListView1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim itmX As ListItem
If Button = vbLeftButton Then
ListView1.DragIcon = ListView1.SelectedItem.CreateDragImage
ListView1.Drag vbBeginDrag
End If
End Sub
Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
Dim nodX As Node
If Source Is ListView1 Then
If Not TreeView1.DropHighlight Is Nothing Then
Set nodX = TreeView1.DropHighlight
'Operations on nodX if wanted --> eg create new subnode, ...
Set TreeView1.DropHighlight = Nothing
End If
End If
End Sub
[\vbcode]
Greetings
Yves.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.