i have a comboBox that is been created at RunTime and i need to refere to it to retreive Data From it but i don't know how
this is the code that i create it with:
for (int i=0;i<inArabicStudentsNames.Count();i++)
{
ComboBox studentsBox = new ComboBox();
studentsBox.Location = new Point(locationComboBoxX,locationComboBoxY);
studentsBox.Size = new Size(sizeComboBoxWidth, sizeComboBoxHeigth);
studentsBox.Name = "students_combo" + i;
studentsBox.Font =new Font("Times New Roman",10);
studentsBox.Parent = this;
listOfCombos.Add(studentsBox);
Controls.Add(studentsBox);
for (int j = 0; j < notFoundStudentsfromOtherTable.Count(); j++)
studentsBox.Items.Add(notFoundStudentsfromOtherTable[j]);
locationComboBoxY += 30;
}
i need to refere to it in this position
private void button1_Click(object sender, EventArgs e)
{
for(int i = 0; i < inArabicStudentsNames.Count(); i++)
{
if(! String.IsNullOrEmpty((/* My ComboBox */).Text))
{
//My Code
}
}
}
if anyone could help me please