I am trying to create a forms application in C# that will create several comboboxes, populate them with selectable items and then be able to detect what items were selected. I have the first two parts working: I can create the combo boxes, add the items to them, but when I try to write the code to read what items have been selected, I get errors because the controls don’t exist at build time..
public System.Windows.Forms.ComboBox AddNewSEPComboBox()
{
System.Windows.Forms.ComboBox SEPcbox = new System.Windows.Forms.ComboBox();
this.Controls.Add(SEPcbox);
SEPcbox.Top = A * 28;
SEPcbox.Left = 250;
string[] SEPSTAT = new string[]{"current (12.1.4013.4013), no changes made.", "not installed, no changes made.", "not installed, latest version (12.1.4013.4013) installed.", "outdated, updated to the latest version (12.1.4013.4013).", "outdated, no changes made."};
SEPcbox.Items.AddRange(SEPSTAT);
SEPcbox.Name = "SEPcbox" + A;
A++;
return SEPcbox;
Thanks in advance!