Bonjour,
voila la situation dans une Userform j´ai deux listbox grace au listindex lorsque je selectione une ligne dans la listbox1 la meme est selectionée dans la listbox2
Private Sub ListBox1_Click()
LB_Bilder_2.Value = LB_Bilder_2.List(ListBox1.ListIndex)
End Sub
Private Sub LB_Bilder_2_Click()
ListBox1.Value = ListBox1.List(LB_Bilder_2.ListIndex)
End Sub
grace au des spinbutton je peux deplace les items de ma listbox1 vers le bas ou le haut.
ce que je veux cer pouvoir deplacer en meme temps la meme ligne dans ma listbox2
code des spinbouton:
Private Sub SpinButton1_SpinDown()
Dim Suiv As String, x As Integer
With LB_Bilder_2
If .ListIndex = LB_Bilder_2.ListCount - 1 Then Exit Sub
Suiv = .List(.ListIndex + 1)
.List(.ListIndex + 1) = .List(.ListIndex)
.List(.ListIndex) = Suiv ' Resélection de l'élément déplacé
.ListIndex = .ListIndex + 1
End With
End Sub
Private Sub SpinButton1_SpinUp()
Dim Prec As String, x As Integer
With LB_Bilder_2
If .ListIndex = 0 Then Exit Sub
Prec = .List(.ListIndex - 1)
.List(.ListIndex - 1) = .List(.ListIndex)
.List(.ListIndex) = Prec ' Resélection de l'élément déplacé
.ListIndex = .ListIndex - 1
End With
End Sub
Merci pour votre aide