Private Sub B_enlève_Click()
If Me.Dest.ListIndex <> -1 And Me.Dest.ListCount > 0 Then
For i = 0 To Me.Dest.ListCount - 1
If Me.Dest.Selected(i) = True Then
Me.Source.AddItem Me.Dest.List(i)
pos = Me.Source.ListCount - 1
Me.Source.List(pos, 1) = Me.Dest.List(i, 1)
'---histo
Me.Historique.AddItem Me.Dest.List(i)
posh = Me.Historique.ListCount - 1
Me.Historique.List(posh, 1) = Me.Dest.List(i, 1)
Me.Historique.List(posh, 2) = Me.Destination.Caption
Me.Historique.List(posh, 3) = Format(Now, "hh:mm le dd/mm/yyyy")
'---Main courante
Me.Main.AddItem Me.Dest.List(i) ' bug lorsque l'on clique une seconde fois dans le cas Retour PC
posh = Me.Main.ListCount - 1
Me.Main.List(posh, 0) = Me.Dest.List(i, 1)
Me.Main.List(posh, 1) = Me.Destination.Caption
Me.Main.List(posh, 2) = Format(Now, "hh:mm le dd/mm/yyyy")
End If
Next i
'For j = Me.Dest.ListCount - 1 To 0 Step -1
'If Me.Dest.Selected(j) = True Then Me.Dest.RemoveItem (j)
'Next j
If Me.Dest.ListCount > 0 And Me.Dest.ListIndex <> -1 Then Me.Dest.RemoveItem Me.Dest.ListIndex
End If
B_transfert_Click
B_Histo_Click
B_Main_Click