[VB6] Apel a partir d'un ListBox

cs_patoch Messages postés 62 Date d'inscription jeudi 12 avril 2001 Statut Membre Dernière intervention 25 septembre 2007 - 7 mai 2006 à 16:39
cs_patoch Messages postés 62 Date d'inscription jeudi 12 avril 2001 Statut Membre Dernière intervention 25 septembre 2007 - 7 mai 2006 à 17:26
Bonjour

Voila une partie de code en example :
Je voudrais a partir d'une liste de nom de ville dans un ListBox, apeler un des Label ci dessous ,example : Mont de Marsan = L40
Blois = L41

Je precise que j'ai plus de cent Label

Private Sub L40_Click()


LitDepartement 40
Label1.Caption = "Département des Landes"
Dim path
path = App.path
If Right$(path, 1) <> "" Then path = path & ""
Image2.Picture = LoadPicture(App.path & "\Image\Landes" & ".jpg")
Image1.Picture = LoadPicture(App.path & "\Image\si_d40" & ".gif")
End Sub

Private Sub L41_Click()


LitDepartement 41
Label1.Caption = "Département du Loir-et-Cher "
Dim path
path = App.path
If Right$(path, 1) <> "" Then path = path & ""
Image2.Picture = LoadPicture(App.path & "\Image\Loir-et-Cher" & ".jpg")
Image1.Picture = LoadPicture(App.path & "\Image\si_d41" & ".gif")
End Sub

Merci pour la reponse

2 réponses

crenaud76 Messages postés 4172 Date d'inscription mercredi 30 juillet 2003 Statut Membre Dernière intervention 9 juin 2006 28
7 mai 2006 à 17:15
Il aurait été bien de faire un groupe de Label !! Parce que la !! Tu ne t'en sortira pas !

CR
0
cs_patoch Messages postés 62 Date d'inscription jeudi 12 avril 2001 Statut Membre Dernière intervention 25 septembre 2007
7 mai 2006 à 17:26
Avec un groupe de label c'est possible ?
0
Rejoignez-nous