1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
Private Sub listbox1_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean _
, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single _
, ByVal DragState As Long, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
Cancel = True
Effect = 1
End Sub
Private Sub listbox1_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean _
, ByVal Action As Long, ByVal Data As MSForms.DataObject, ByVal X As Single _
, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
Cancel = True
Effect = 1
Me.ListBox1.AddItem Data.GetText
End Sub
Private Sub listbox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim MyDataObject As DataObject
If Button = 1 Then
Set MyDataObject = New DataObject
Dim Effect As Integer
MyDataObject.SetText Me.ListBox1.Value
Effect = MyDataObject.StartDrag
Me.ListBox1.RemoveItem Me.ListBox1.ListIndex
Else
If Me.ListBox1.ListCount > 0 Then
Me.ListBox1.ControlTipText = "Transfert <- possible par glisser-déplacer !"
End If
End If
End Sub |
Partager