dimanche 19 avril 2015

How can i loop over all comboBoxes controls i have and add the items of each comboBox to a List?

I tried:



var comboBoxes = this.Controls
.OfType<ComboBox>()
.Where(x => x.Name.StartsWith("comboBox"));

foreach (var cmbBox in comboBoxes)
{
CMBXWMICLASSES.AddRange(cmbBox.Items[
}


But inside the loop the foreach how do i add the Items of each comboBox ?


Aucun commentaire:

Enregistrer un commentaire