I have a windows from with menustrip containing 19 items. After loading the form if I try to close the menu items(Right click on menu bar and close), I am able to close first 17 items but not last 2 items. I have changed the order of the items and tried to close. Even after changing, the last two items cant be closed. I have checked all properties but didnt find any difference. Can any one help in solving my problem. Thanks in advance.
Loading

Leela Kumar SalumuriPosted May 27, 2014, 3:34 AM
Thanks,
Leela
Leela Kumar SalumuriPosted May 27, 2014, 3:33 AM
// is clicked.
private void columnsMenuStrip_Closing(object sender, ToolStripDropDownClosingEventArgs e)
{
if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked)
e.Cancel = true;
}
// This menu item click function will show or hide the assembly tree viewer columns
private void toolStripMenuItem1_Click(object sender, EventArgs e)
{
int menuStripItemIndex = columnsMenuStrip.Items.IndexOf((ToolStripMenuItem)sender);
if (((ToolStripMenuItem)sender).Checked)
{
((ToolStripMenuItem)sender).Checked = false;
columnsWidth[menuStripItemIndex + 1] = assemblyTreeHeaderListView.Columns[menuStripItemIndex + 1].Width;
assemblyTreeHeaderListView.Columns[menuStripItemIndex + 1].Width = 0;
assemblyViewr_pnl.Width = assemblyViewr_pnl.Width - columnsWidth[menuStripItemIndex + 1];
assemblyTreeHeaderListView.Width = assemblyTreeHeaderListView.Width - columnsWidth[menuStripItemIndex + 1];
}
else
{
((ToolStripMenuItem)sender).Checked = true;
assemblyTreeHeaderListView.Columns[menuStripItemIndex + 1].Width = columnsWidth[menuStripItemIndex + 1];
assemblyViewr_pnl.Width = assemblyViewr_pnl.Width + columnsWidth[menuStripItemIndex + 1];
assemblyTreeHeaderListView.Width = assemblyTreeHeaderListView.Width + columnsWidth[menuStripItemIndex + 1];
}
}
Nilesh AvhadPosted May 19, 2014, 8:47 AM
can you please share your code here with some more detail.
Thanks,
Nilesh