实现效果:

  设置菜单项是否可用_ide

知识运用:

  ToolStripMenuItem菜单项的Enabled属性  //指示菜单项是否可用

  public override bool Enabled { get;set; }

实现代码:  

        private void btn_Enable_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem P_toolStripMenuItem = (ToolStripMenuItem)menuStrip1.Items[0];
            foreach (ToolStripMenuItem item in P_toolStripMenuItem.DropDownItems) {
                item.Enabled = true;
            }
        }