1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Private Sub ComboBox1_Change()
MsgBox "Selection N° " & ComboBox1.ListIndex & _
vbCrLf & " = " & ComboBox1.List(ComboBox1.ListIndex, 0) & _
vbCrLf & " Code : " & ComboBox1.List(ComboBox1.ListIndex, 1)
End Sub
Private Sub Form_Load()
ComboBox1.ColumnCount = 2
ComboBox1.ColumnWidths = ";0" ' Pour masquer la 2° colonne
ComboBox1.AddItem "TOTO"
ComboBox1.Column(1, 0) = "O"
ComboBox1.AddItem "TITI"
ComboBox1.Column(1, 1) = "I"
ComboBox1.AddItem "TUTU"
ComboBox1.Column(1, 2) = "U"
End Sub |
Partager