Treeview Control (Reacting to DragOver Event):   Return to List

Dim xNod as Node
Private Sub Treeview1_DragOver(Source As Control, x As Single, y As Single, State As Integer)
If optDragOn.Value = True Then
    If inDrag = True Then
        ' Set DropHighlight to the mouse's coordinates.
        Set Treeview1.DropHighlight = Treeview1.HitTest(x, y)
        intIndex = Treeview1.DropHighlight.Index
        Treeview1.Nodes.Item(intIndex).EnsureVisible' Repositions at the top
    End If
End If
End Sub

' All nodes in a Treeview have 2 basic properties:
    Node.Text -- The text displayed in the Treeview control
    Node.Key -- The assigned key -- used to attach children & perform other manipulations on the particular node.

See also:
Treeview ... Adding Nodes
Treeview ... Adding Root Node
Treeview ... Collapsing Nodes to Root Level
Treeview ... Complete Subprocedure for Collapsing Nodes
Treeview ... Counting Number of Nodes
Treeview ... Expanding All Nodes
Treeview ... Determing selected Node and Highlighting it
Treeview ... ChildNode Info of Selected Node
Treeview ... Text of Selected Node
Treeview ... Node Click Event
Treeview ... Number of Children (in parens) appended to Text of Selected Node
Treeview ... Reacting to Drag and Drop
Treeview ... Repositioning Cursor to the Top of the Treeview



Note to Webmaster