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

#2
If the drag moves over a ListBox, the DragOver event gives the control a chance to allow or prohibit the drag. The following code checks whether the drag can provide a string as data. If so, then it checks whether the Ctrl key is down and allows a move or copy effect.

' Display the appropriate cursor.
Private Sub lstFruits_DragOver(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.DragEventArgs) Handles _
    lstFruits.DragOver, lstAnimals.DragOver
    Const KEY_CTRL As Integer = 8

    If Not (e.Data.GetDataPresent(GetType(System.String))) _
        Then
        e.Effect = DragDropEffects.None
    ElseIf (e.KeyState And KEY_CTRL) And _
    (e.AllowedEffect And DragDropEffects.Copy) = _
        DragDropEffects.Copy Then
        ' Copy.
        e.Effect = DragDropEffects.Copy
    ElseIf (e.AllowedEffect And DragDropEffects.Move) = _
        DragDropEffects.Move Then
        ' Move.
        e.Effect = DragDropEffects.Move
    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:37
Task