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 47 48 49 50 51
| Option Explicit
Dim UpdateLB As Boolean
Private Sub CB_Selection_Change()
Debug.Print "CB_Selection_Change"
LB_OPTION_Change
End Sub
Private Sub CB_Selection_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Debug.Print "CB_Selection_KeyUp"
UpdateLB = True
End Sub
Private Sub CB_Selection_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Debug.Print "CB_Selection_MouseUp"
UpdateLB = True
End Sub
Private Sub LB_OPTION_Change()
Dim i As Integer
Dim Tout As Boolean
If UpdateLB = True Then
If CB_Selection.Value = True Then
For i = 0 To LB_Option.ListCount - 1
If LB_Option.Selected(i) = False Then
LB_Option.Selected(i) = True
End If
Next i
Else
For i = 0 To LB_Option.ListCount - 1
If LB_Option.Selected(i) = True Then
LB_Option.Selected(i) = False
End If
Next i
End If
Else
Tout = True
For i = 0 To LB_Option.ListCount - 1
If LB_Option.Selected(i) = False Then
Tout = False
End If
Next i
If Tout = False Then
CB_Selection.Value = False
Else
CB_Selection.Value = True
End If
End If
UpdateLB = False
End Sub |
Partager