List box

hamid_raf Messages postés 36 Date d'inscription mercredi 25 janvier 2006 Statut Membre Dernière intervention 28 décembre 2008 - 18 juil. 2008 à 09:58
hamid_raf Messages postés 36 Date d'inscription mercredi 25 janvier 2006 Statut Membre Dernière intervention 28 décembre 2008 - 18 juil. 2008 à 16:20
Salut,
je suis en periode de stage, dans une société et je réalise une application VB avec base de données sous Excel,
j'ai mis 4 listes pour récupérer des informations, et je veux que quand je clique sur un élément dans une liste, il va séléctionner l'element qui a le meme index dans les autres listes, j l'ai fait pour deux et s a marché, mais pour les quatres il me donne "Espace pile insiffusant"
voici le code source:

Private Sub List2_Click()
'MsgBox (List3.Selected(2))
List3.Text = List3.List(List2.ListIndex)
List4.Text = List4.List(List2.ListIndex)
List5.Text = List5.List(List2.ListIndex)

'MsgBox (List3.SelCount)

End Sub

Private Sub List3_Click()
List2.Text = List2.List(List3.ListIndex)
List4.Text = List4.List(List3.ListIndex)
List5.Text = List5.List(List3.ListIndex)
End Sub

Private Sub List4_Click()
List2.Text = List2.List(List4.ListIndex)
List3.Text = List3.List(List4.ListIndex)
List5.Text = List5.List(List4.ListIndex)
End Sub

Private Sub List5_Click()
List2.Text = List2.List(List5.ListIndex)
List3.Text = List3.List(List5.ListIndex)
List4.Text = List4.List(List5.ListIndex)
End Sub
help ssvp
hamid
I wana get the knowledge of the entire World,...........

4 réponses

cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 15
18 juil. 2008 à 10:33
Salut,

Tu dit sélectionner ?? Alors pour quoi ne pas utiliser la propriété : Selected des listbox ?? Regarde et tu comprendras ^^

A+
Exploreur

 Linux a un noyau, Windows un pépin
0
hamid_raf Messages postés 36 Date d'inscription mercredi 25 janvier 2006 Statut Membre Dernière intervention 28 décembre 2008
18 juil. 2008 à 15:43
selected t'informe si tu a selectionné l'élément voulu ou non, si oui il donne true sinon il donne false,
mais sayer merci j'ai trouvé la solution. merci

hamid
I wana get the knowledge of the entire World,...........
0
cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 15
18 juil. 2008 à 15:51
Salut,

Bin...si tu as trouvé la solution, fait profiter tous le monde alors et post ta réponse et valide là ^^

A+
Exploreur

 Linux a un noyau, Windows un pépin
0
hamid_raf Messages postés 36 Date d'inscription mercredi 25 janvier 2006 Statut Membre Dernière intervention 28 décembre 2008
18 juil. 2008 à 16:20
bein justment, voila le code :

Private Sub List2_Click()
List3.ListIndex = List2.ListIndex
List4.ListIndex = List2.ListIndex
List5.ListIndex = List2.ListIndex
End Sub

Private Sub List3_Click()
List2.ListIndex = List3.ListIndex
List4.ListIndex = List3.ListIndex
List5.ListIndex = List3.ListIndex
End Sub
Private Sub List4_Click()
List2.ListIndex = List4.ListIndex
List5.ListIndex = List4.ListIndex
List3.ListIndex = List4.ListIndex
End Sub

Private Sub List5_Click()
List2.ListIndex = List5.ListIndex
List4.ListIndex = List5.ListIndex
List3.ListIndex = List5.ListIndex
End Sub

hamid
I wana get the knowledge of the entire World,...........
0
Rejoignez-nous