Question

I am trying to Enable = false to menustrip.. but code the code is executing but not able to disable the menus

        MenuStrip ms = (MenuStrip)frm_MDI.objMdi.Controls["msMainMenu"];
        foreach (ToolStripMenuItem tmm in ms.Items)
        {
            tmm.Enabled = false;
        }
Était-ce utile?

La solution

After adding objMdi = this; on load event. it work's fine.

    private void frm_MDI_Load_1(object sender, EventArgs e)
    {
        objMdi = this;
    }
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top