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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
Option Explicit
Public WithEvents GroupListBoxs As MSForms.ListBox
Private Sub GroupListBoxs_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)
If LaListBox = GroupListBoxs.Name Then Exit Sub
Cancel = True
Effect = 1
End Sub
Private Sub GroupListBoxs_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)
If LaListBox = GroupListBoxs.Name Then Exit Sub
Cancel = True
Effect = 1
GroupListBoxs.AddItem Data.GetText
End Sub
Private Sub GroupListBoxs_MouseMove(ByVal Button As _
Integer, ByVal Shift As Integer, ByVal X As _
Single, ByVal Y As Single)
Dim MyDataObject As DataObject
LaListBox = GroupListBoxs.Name
If Button = 1 Then
Set MyDataObject = New DataObject
Dim Effect As Integer
If IsNull(GroupListBoxs) Then Exit Sub
MyDataObject.SetText GroupListBoxs.Value
Effect = MyDataObject.StartDrag
End If
End Sub |
Partager