[VB6] Apel a partir d'un ListBox
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
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| 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