|
-
Aug 18th, 2003, 10:12 AM
#1
Thread Starter
Fanatic Member
dragdrop
Hi,
Before running this code in vb.net windows (Which I have included two treeviews), it gives an error of type expected and the TreeView is underlined.???
Thanks
Public Sub TreeView_DragDrop(ByVal sender As Object, _
ByVal e As DragEventArgs) _
Handles TreeView2.DragDrop, TreeView1.DragDrop
Dim NewNode As TreeNode
If e.Data.GetDataPresent("System.Windows.Forms.TreeNode", False) Then
Dim pt As Point
Dim DestinationNode As TreeNode
pt = CType(sender, TreeView).PointToClient(New Point(e.X, e.Y))
DestinationNode = CType(sender, TreeView).GetNodeAt(pt)
NewNode = CType(e.Data.GetData("System.Windows.Forms.TreeNode"), _
TreeNode)
If Not DestinationNode.TreeView Is NewNode.TreeView Then
DestinationNode.Nodes.Add(NewNode.Clone)
DestinationNode.Expand()
'Remove original node
NewNode.Remove()
End If
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|