Click here to Skip to main content
15,916,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to detect lost internet connection ? Pin
Vimalsoft(Pty) Ltd21-Jan-08 0:30
professionalVimalsoft(Pty) Ltd21-Jan-08 0:30 
GeneralRe: How to detect lost internet connection ? Pin
Steven J Jowett21-Jan-08 2:19
Steven J Jowett21-Jan-08 2:19 
QuestionHow to Pass a Double Quote (")in a string ? Pin
SekharOne20-Jan-08 18:44
SekharOne20-Jan-08 18:44 
AnswerRe: How to Pass a Double Quote (")in a string ? Pin
Nilesh Hapse20-Jan-08 20:38
Nilesh Hapse20-Jan-08 20:38 
AnswerRe: How to Pass a Double Quote (")in a string ? Pin
John_Adams20-Jan-08 22:45
John_Adams20-Jan-08 22:45 
AnswerRe: How to Pass a Double Quote (")in a string ? Pin
The Mighty Atom21-Jan-08 10:20
The Mighty Atom21-Jan-08 10:20 
QuestionGlobal hooks from a Windows Service Pin
Raveheart20-Jan-08 9:15
Raveheart20-Jan-08 9:15 
QuestionDrag and Drop from One Treeview To Another Treeview By VB.Net 2005 Pin
ejaz_pk20-Jan-08 8:07
ejaz_pk20-Jan-08 8:07 
I have 2 treeview on my form and I want to add drag and drop functionality from Treeview1 to Treeview2.


I got the sample code from the net.I tried after making some changes in the code and also tried by copying the same code but its not working.

Down is the samle code which I got from the internet.

[Code]

Private Sub TreeViewExample_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load

treeTwo.AllowDrop = True
treeOne.AllowDrop = True

End Sub

Private Sub treeOne_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles treeOne.MouseDown, treeTwo.MouseDown
Dim tree As TreeView = CType(sender, TreeView)

Dim node As TreeNode
node = tree.GetNodeAt(e.X, e.Y)
tree.SelectedNode = node

If Not node Is Nothing Then
tree.DoDragDrop(node.Clone(), DragDropEffects.Copy)
End If

End Sub

Private Sub treeTwo_DragOver(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles treeOne.DragOver, treeTwo.DragOver
Dim tree As TreeView = CType(sender, TreeView)

e.Effect = DragDropEffects.None

If Not e.Data.GetData(GetType(TreeNode)) Is Nothing Then
Dim pt As New Point(e.X, e.Y)
pt = tree.PointToClient(pt)
Dim node As TreeNode = tree.GetNodeAt(pt)
If Not node Is Nothing Then
e.Effect = DragDropEffects.Copy
tree.SelectedNode = node
End If

End If

End Sub

Private Sub treeTwo_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles treeOne.DragDrop, treeTwo.DragDrop
Dim tree As TreeView = CType(sender, TreeView)
Dim pt As New Point(e.X, e.Y)
pt = tree.PointToClient(pt)

Dim node As TreeNode = tree.GetNodeAt(pt)

node.Nodes.Add(e.Data.GetData(GetType(TreeNode)))

node.Expand()
End Sub
End Class

[/Code]

Can I body tell me where is the problem in the above code or any sample code which is working will be appreciated.

Thanks in advance

Ejaz
GeneralRe: Drag and Drop from One Treeview To Another Treeview By VB.Net 2005 Pin
Paul Conrad20-Jan-08 10:18
professionalPaul Conrad20-Jan-08 10:18 
QuestionRe: Drag and Drop from One Treeview To Another Treeview By VB.Net 2005 Pin
ejaz_pk21-Jan-08 2:35
ejaz_pk21-Jan-08 2:35 
QuestionInstance Pin
roger689720-Jan-08 6:31
roger689720-Jan-08 6:31 
GeneralRe: Instance Pin
Colin Angus Mackay20-Jan-08 10:50
Colin Angus Mackay20-Jan-08 10:50 
QuestionPocket PC Connections? Pin
Widgets20-Jan-08 2:16
Widgets20-Jan-08 2:16 
GeneralSyntax Highlighting Pin
The Mighty Atom20-Jan-08 2:03
The Mighty Atom20-Jan-08 2:03 
GeneralRe: Syntax Highlighting Pin
The ANZAC20-Jan-08 18:36
The ANZAC20-Jan-08 18:36 
GeneralRe: Syntax Highlighting Pin
The Mighty Atom21-Jan-08 2:59
The Mighty Atom21-Jan-08 2:59 
GeneralRe: Syntax Highlighting Pin
The ANZAC21-Jan-08 14:06
The ANZAC21-Jan-08 14:06 
GeneralRe: Syntax Highlighting Pin
The Mighty Atom22-Jan-08 2:04
The Mighty Atom22-Jan-08 2:04 
GeneralGetting the number of rows from a table adapter query Pin
AAGTHosting19-Jan-08 17:17
AAGTHosting19-Jan-08 17:17 
GeneralQuestion about Shared modifier Pin
Alaric_19-Jan-08 11:04
professionalAlaric_19-Jan-08 11:04 
GeneralRe: Question about Shared modifier Pin
Luc Pattyn19-Jan-08 11:51
sitebuilderLuc Pattyn19-Jan-08 11:51 
GeneralRe: Question about Shared modifier [modified] Pin
Alaric_19-Jan-08 12:39
professionalAlaric_19-Jan-08 12:39 
GeneralRe: Question about Shared modifier Pin
Guffa19-Jan-08 13:02
Guffa19-Jan-08 13:02 
GeneralRe: Question about Shared modifier Pin
pmarfleet19-Jan-08 12:00
pmarfleet19-Jan-08 12:00 
GeneralRe: Question about Shared modifier Pin
Alaric_19-Jan-08 12:29
professionalAlaric_19-Jan-08 12:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.