Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drag-and-drop within a treeview

Status
Not open for further replies.

anurc

Programmer
Jul 11, 2002
18
US
I am tying to implement a drag-and-drop ability within a treeview. I could do eveything until i got to the point where i need to find a destination node to drop the dragged node. when i tried to get the node form the e.X and e.Y coordinates, i am not able to exactly get the node over which the mouse was pointing to when the drop occurred. Here is the DragDrop event handler i am using. If anybody has any clue..let me know .

Private Sub treeview1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles treeview1.DragDrop
Dim DroppedNode, targetNode As TreeNode
Try
targetNode = CType(treeview1.GetNodeAt(PointToClient(New Point(e.X, e.Y))), TreeNode)
''the targetnode i get is not exactly same as the one i wanted

Catch ex As Exception

End Try

End Sub

Thnaks for any advice
anurc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top