tags:

views:

445

answers:

1

I am working with a ToolStripMenuItem in winforms.Setting

splitLineItemToolStripMenuItem.Visible = true;

does not make it visible as the container ContextMenuStrip visiblity is false; I understand that if container visibility is false,child element cannot be set to true.

IS there any workaround to make it visible.

A: 

I had a similar problem with a class inheriting from System.Web.UI.Control. I think a workaround to your situation is:

public class MyToolStripMenuItem : ToolStripMenuItem 
{
    public override bool Visible {get;set;}
}

...and then use MyToolStripMenuItem instead of ToolStripMenuItem.

beon