I'm lost here, I wanna remove the item from ComboBox once it's been selected in the previous ComboBox. I have tried many approaches but didn't resolve this problem. Please help me in solving this problem and below I've included all of the code. Any tips would be greatly appreciated!
- ComboBox[] combo_for_constraint = new ComboBox[count];
- int combo_for_constraint_x = 250, combo_for_constraint_y = 50;
- for (int i = 1; i < count; i++)
- {
- combo_for_constraint[i] = new ComboBox();
- combo_for_constraint[i].Location = new System.Drawing.Point(combo_for_constraint_x,
- combo_for_constraint_y + (i * 10));
- combo_for_constraint[i].Size = new Size(100, 50);
- combo_for_constraint[i].Name = "combo_for_constraintbx" + i.ToString();
- combo_for_constraint[i].DropDownStyle = ComboBoxStyle.DropDownList;
- tabPage2.Controls.Add(combo_for_constraint[i]);
- tabPage2.ResumeLayout(false);
- combo_for_constraint_y += 40;
- tabPage2.Refresh();
- if (i >= 2 && combo_for_constraint[i - 1].Text == "PRIMARY KEY")
- {
- combo_for_constraint[i + 1].Items.RemoveAt(1);
- }
- else
- {
- combo_for_constraint[i].Items.Add("UNIQUE");
- combo_for_constraint[i].Items.Add("PRIMARY KEY");
- combo_for_constraint[i].Items.Add("FOREIGN KEY");
- }
- }
-