I have a small project having toolstripmenuitem. I wish to remove toolstripmenuitem during the form_pageLoad()...Is it possible?
My Codes
for each(ToolStripMenuItem dropDownItem in reportstoolStripDropDownButton.DropDownItems) {
if (dropDownItem.Name == MyTable.Rows[M1]["report_menu_name"].ToString()) {
//MessageBox.Show(dropDownItem.Name);
reportstoolStripDropDownButton.DropDownItems.Remove(dropDownItem);
}
}
Error Messages:
Invalid OperationException was unhandled - Collection was modified : Enumeration Operation may not execute
Thanks for the helps