How do you take the contents of a combo box and add them to an array?
arrays, c#, combobox
Solution
string[] items = new string[currentComboBox.Items.Count];
for(int i = 0; i < currentComboBox.Items.Count; i++)
{
items[i] = currentComboBox.Items[i].ToString();
}
Problem
I've seen a lot about adding the contents of an `Array` to a `ComboBox`, but not the other way around. I would like to take the contents of a `ComboBox` add them to an `Array` to be sent to another method for processing. I've already got the `.Items.Count` to determine the size of the `Array`, but I can't figure out how to cycle through the items in the `ComboBox`.