OleDragOver event fired too early

Summary

Id: 13463.20
Type: Bug Bug
Current Status: Resolved

Detail

10 Feb 2004 Open Steve McMahon

The OleStartDrag event is fired before the control has evaluated which item the user is dragging over. This means it is impossible to determine on a node-by-node basis whether the item can be dropped on an item.

26 Feb 2004 Resolved Steve McMahon

Moved OleStartDrag event after the current drag item has been evaluated. This allows you to set the Effect for the drag on a node by node basis using code like this:

Private Sub tvw_OLEDragOver(Data As DataObject, _
   Effect As Long, _
   Button As Integer, _
   Shift As Integer, _
   x As Single, y As Single, State As Integer)
   
Dim nodeDrag as cTreeViewNode
Dim nodeOver as cTreeViewMode
  
   Effect = vbDropEffectNone
 
   Set nodeDrag = tvw.NodeFromDragData(Data)
   Set nodeOver = tvw.DragInsertNode
   If Not(nodeDrag Is Nothing) And _
      Not(nodeOver Is Nothing) Then
      
      ‘ Perform check here if ok to drop on nodeOver
      If OkToDropOn(nodeOver, nodeDrag) Then
          Effect = vbDropEffectCopy
      End If
 
   End If
 
End Sub