Condition ComboBox VB.Net

pictom41 Messages postés 537 Statut Membre -  
 mathsroller97 -
J'ai un problème avec mes ComboBox, je vous fais voir le code :
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged

If ComboBox1.SelectedValue = "Lady Gaga" Then

ComboBox2.Items.Add("Alejandro")

End If

End Sub

Sauf que quand je choisis Lady Gaga dans la combobox 1, je n'ai pas Alejandro dans la 2ème combobox.
Il y aurait t'il un raté dans ma condition ?
Ou autre ?
Cordialement

1 réponse

  1. pm31 Messages postés 65 Statut Membre 1
     
    Bonjour , essaie ça :

    If ComboBox1.SelectedItem = "Lady Gaga" Then

    ComboBox2.Items.Add("Alejandro")

    End If

    CDLT
    1
    1. mathsroller97
       
      merci ça marche :)
      0