Drag and drop from listbox to textbox in vb.net

 
Following example shows drag and drop functionality between Listbox and Textbox using vb.net

Private Sub Listbox1_Mousedown(ByVal Sender As Object, _
                                   ByVal e As System.Windows.Forms.MouseEventArgs) Handles Listbox1.Mousedown
        Dim Selecteditems As String
        For i As Integer = 0 To Listbox1.Selecteditems.Count - 1
            Selecteditems = Selecteditems & "," & Listbox1.Selecteditems.Item(i)
        Next
        Listbox1.Dodragdrop(Selecteditems, DragDropEffects.Copy Or DragDropEffects.Move)
End Sub
 Private Sub TextBox1_DragEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles TextBox1.DragEnter
        e.Effect = DragDropEffects.Copy
End Sub
 
Private Sub TextBox1_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles TextBox1.DragDrop
        TextBox1.Text = e.Data.GetData(DataFormats.Text).ToString
End Sub