Skip to main content

AccessTr.neT


Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın

Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın

#3
' 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
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Dizeleri Bir Listbox'tan Diğerine Sürükleyip Bırakın - Yazar: accessman - 23/01/2020, 08:38
Task