TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Muhammad Ahsan
NA
265
6.9k
Remove the item from ComboBox once it's been selected in the previous
Jan 5 2021 6:04 PM
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"
);
}
}
Reply
Answers (
2
)
Select data from changed entity
if statement in LINQ?