Borkan
Borkan

Reputation: 29

How to disable MenuStrip MaximizeBox

How can i disable the MaximizeBox of MenuStrip when isMidContaine = true of the main form. I want it to be disable not to hide ControlBox of the form as i read in some solutions.

    private void Show_Form_Click(object sender, EventArgs e)
    {
        Form1 f = new Form1();
        f.MdiParent = this;
        f.WindowState = FormWindowState.Maximized;
        f.Show();
    }

enter image description here

Upvotes: 1

Views: 98

Answers (1)

Leo Chapiro
Leo Chapiro

Reputation: 13984

Try this:

private void Show_Form_Click(object sender, EventArgs e)
{
    Form1 f = new Form1();
    f.MdiParent = this;

    f.Show();

    // Disable maximize box
    f.MaximizeBox = false;
    f.WindowState = FormWindowState.Maximized;
}

Upvotes: 6

Related Questions