Private Sub UserForm_Activate() For i = 1 To 3 ListBox1.AddItem " a" & i Next End Sub Private Sub CommandButton1_Click() ListBox1.Visible = Not ListBox1.Visible End Sub Private Sub ListBox1_Click() If ListBox1.ListIndex < 0 Then Exit Sub MsgBox "tu as choisi l'article " & ListBox1.List(ListBox1.ListIndex) & " et tu ne vois plus la listbox" CommandButton1.SetFocus DoEvents ListBox1.Visible = Not ListBox1.Visible End Sub
Dim deja as string Private Sub ComboBox1_Click() toto = ComboBox1.ListIndex If InStr(deja, "@" & toto & "@") = 0 Then deja = deja & "@" & toto & "@" Else ComboBox1.ListIndex = -1 End If End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub ComboBox1_Change() MsgBox "tu as sélectionné l'article " & ComboBox1.List(ComboBox1.ListIndex) ComboBox1.Enabled = False End Sub