Use the DragOver event to determine what you are dragging over - (as you
should anyway to determine whether its ok to do so) and then set the current
item as the selected item (something like this - )
Private Sub TreeView_DragOver(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles TreeView.DragOver
' Assume we can't drop
' Ok, are we currently over a tree node?
Dim mousePos As Point
mousePos = TreeView.PointToClient(Cursor.Position)
Dim nodeOver As MultiSelectTreeViewNode =
CType(TreeView.GetNodeAt(mousePos), MultiSelectTreeViewNode)
If nodeOver Is Nothing Then
Exit Sub
Else
TreeView.SelectedNode = nodeOver
end if
end sub
Well, yes it will - there is no other way of doing it, unless you store the
current node (nodeOver), change its colour manually then next time you go
into the onDragDrop you change the colour back before storing the new one.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.