Search code examples
winformsmenustrip

Disable MenuStrip Dropdown in Windows Forms Application


I am disabling the parent menu option in a Windows forms menustrip. When you hover over it, the submenu still opens. Is there a way to disable the submenu opening or do I have to disable all the submenu items?


Solution

  • I ended up looping through the DropDownItems and disabling them after I disable the main item.

    for (int i = 0; i < this._menuOpen.DropDownItems.Count; i++)
    {
        this.menuOpen.DropDownItems[i].Enabled = false;
    }