1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Private Sub ListBox2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
With ListBox2
If Button = 1 Then
If Shift = 0 Then
If .ListIndex > 1 Then .Selected(.ListIndex - 1) = False
.Selected(.ListIndex) = True
If .ListIndex < .ListCount - 2 Then .Selected(.ListIndex + 1) = False
ElseIf Shift = 2 Then
.Selected(.ListIndex) = True
End If
End If
End With
End Sub
Private Sub ListBox2_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim i&, t$
With ListBox2
For i = 0 To .ListCount - 1
If .Selected(i) = True Then t = t & " " & .List(i)
Next
Me.Caption = "item selectionnés " & Replace(Application.Trim(t), " ", ",")
End With
End Sub |
Partager