How to drag/drop labels ,that created at run time
this is my code ...
Private Sub server1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles server1.Click
'create new form
Dim ser1 As New Form
Dim l1 As New Label()
ser1.Location = New Point(123, 28)
ser1.Height = 95
ser1.Width = 206
l1.AllowDrop = True
l1.Name = "Lab1"
l1.Text = "label1"
l1.Location = New Point(5, 5 )
ser1.Controls.Add(l1)
ser1.Show()
l1.DoDragDrop(l1, DragDropEffects.Move)
End Sub
Private Sub picturebox3_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles server3.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text)) Then
' Display the copy cursor.
e.Effect = DragDropEffects.Copy
Else
' Display the no-drop cursor.
e.Effect = DragDropEffects.None
End If
End Sub