You can use DataSource
to bind the ArrayList
to your combobox:
yourComboBox.DataSource = yourArrayList;
Use DisplayMember
and ValueMember
to select what is displayed and what is evaluated as Value
of the item:
yourComboBox.DisplayMember = "Displayed thing";
youtComboBox.ValueMember = "Evaluated thing";
If you don't specify the DisplayMember
, the ToString()
will be called on each item to get the displayed string instead. In your case, it looks like you have an ArrayList
of string, so you don't need to specify any values for DisplayMember
and ValueMember
.
NOTE: You should use a List<T>
instead, it would be better. ArrayList
is just an old stuff.