I just implemented a drag and drop in a treeview. Thist is what I did:
So far so good....Code:Private Sub treDatabase_ItemDrag(...) Handles treDatabase.ItemDrag DoDragDrop(e.Item, DragDropEffects.Move) End Sub Private Sub treDatabase_DragEnter(...) Handles treDatabase.DragEnter e.Effect = DragDropEffects.Move End Sub Private Sub treDatabase_DragDrop(...) Handles treDatabase.DragDrop Dim pt As Point Dim destNode As TreeNode If e.Data.GetDataPresent("BOSS_IBS_Addin.DatabaseTreeNode", False) Then pt = CType(sender, TreeView).PointToClient(New Point(e.X, e.Y)) destNode = CType(sender, TreeView).GetNodeAt(pt) udtDatabaseTreeNodeCut = CType(e.Data.GetData("BOSS_IBS_Addin.DatabaseTreeNode"), DatabaseTreeNode) blnNodeCutInsert(udtDatabaseTreeNodeCut, Me.treDatabase, objDatabases, destNode) End If End Sub
But now there is the following problem.
If I select a menu of my contextmenu the treDatabase_DragDrop is executed again.
Any ideas?




Reply With Quote