' Drop the entry in the list.
Private Sub lstFruits_DragDrop(ByVal sender As Object, _
ByVal e As System.Windows.Forms.DragEventArgs) Handles _
lstFruits.DragDrop, lstAnimals.DragDrop
If e.Data.GetDataPresent(GetType(System.String)) Then
If (e.Effect = DragDropEffects.Copy) Or _
(e.Effect = DragDropEffects.Move) Then
Dim lst As ListBox = DirectCast(sender, ListBox)
Dim item As Object = _
CType(e.Data.GetData(GetType(System.String)), _
System.Object)
Dim pt As Point = lst.PointToClient(New _
Point(e.X, e.Y))
Dim index As Integer = lst.IndexFromPoint(pt.X, _
pt.Y)
If index = ListBox.NoMatches Then
lst.Items.Add(item)
Else
lst.Items.Insert(index, item)
End If
End If
End If
End Sub
Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın
Konuyu Okuyanlar: 1 Ziyaretçi