Probably the simplest approach is Data Binding. For example:
List<string> items = new List<string> { "Item1", "Item2", "Item3" };
listBox1.DataSource = items;
comboBox1.DataSource = items;
If you want to use an explicit loop, then try something like this:
List<string> items = new List<string> { "Item1", "Item2", "Item3" };
FillListBoxOrComboBox( listBox1, items );
FillListBoxOrComboBox( comboBox1, items );
where
static void FillListBoxOrComboBox( dynamic control, IEnumerable<string> items )
{
foreach( var i in items )
{
control.Items.Add( i );
}
}
Also note that both of ListBox and ComboBox are derived from ListControl.