D
David C. Holley
Not having any luck with finding documentation & explanations on doing
drag/drop with a TreeView, I've started taking baby steps.
Question #1. How do I prevent a user from selecting a node that
shouldn't be dragged? Do I need to add code to the OLEStartDrag event to
somehow cancel it? Or is it another event? (The only nodes that should
be dragged are those with a .Tag of 'transport'.)
Question #2. Is there a way to change cursor image when the item being
dragged is dragged over an item to which it cannot be dropped?
Private Sub TreeView_OLEStartDrag(Data As Object, AllowedEffects As Long)
Debug.Print "OLEStartDrag"
Debug.Print Me.TreeView.Object.SelectedItem.Tag,
Me.TreeView.Object.SelectedItem.Key
Set selectedNode = Me.TreeView.Object.SelectedItem
Me!TreeView.Object.SelectedItem = Nothing
End Sub
drag/drop with a TreeView, I've started taking baby steps.
Question #1. How do I prevent a user from selecting a node that
shouldn't be dragged? Do I need to add code to the OLEStartDrag event to
somehow cancel it? Or is it another event? (The only nodes that should
be dragged are those with a .Tag of 'transport'.)
Question #2. Is there a way to change cursor image when the item being
dragged is dragged over an item to which it cannot be dropped?
Private Sub TreeView_OLEStartDrag(Data As Object, AllowedEffects As Long)
Debug.Print "OLEStartDrag"
Debug.Print Me.TreeView.Object.SelectedItem.Tag,
Me.TreeView.Object.SelectedItem.Key
Set selectedNode = Me.TreeView.Object.SelectedItem
Me!TreeView.Object.SelectedItem = Nothing
End Sub