I have some code in Windows Forms application.
I want to change the visibility of my drop down ToolStripMenuItems in code.
I set the Visible property, but when I set a breakpoint and inspect the property value, the visibility of the items has not changed.
Here is my code:
foreach (ToolStripMenuItem it in _frmMain.menuStripMain.Items)
{
foreach (ToolStripMenuItem i in it.DropDownItems)
{
if (i.Text == this._listAppSchema[0].ObjectName.ToString())
{
i.Visible = true;
}
else
{
i.Visible = false;
}
}
}
How to Solve this?