To add an item to a combo box during runtime, you can use the following syntax:
Combo1.AddItem Item
, Index
where Item
is a string containing the text to be displayed
for that item. Index
is an optional value to identify that
item. You can only use a valid value. For example:
Combo1.AddItem "David", 4
is only valid if the list already has 4 items (remember the index starts from 0) If omitted, a default value is added. (0 is the first item on the list, 1 the second and so on). The following code adds three items to a combo box: David, Paul and Sarah.
Combo1.AddItem "David"
Combo1.AddItem "Paul"
Combo1.AddItem "Sarah"
Comments