Dr.Vista
Dr.Vista

Reputation: 139

Prevent MDI child Control box from showing

i tried every single way could help but still not working !!

so when i did hide the control box.. a smaller one appears up there above the parent from's menuStrip

is there anyway to prevent this keep showing up??!

here is the code :

public partial class Form1 : Form
    {
        Alerts a = new Alerts();
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (a == null)
            {
                a = new Alerts();
            }

            a.MdiParent = this;
            a.ControlBox = false;
            a.Dock = DockStyle.Fill;
            a.Show();
            a.BringToFront();
        }
    }

and for sure i made it maximized ..

Upvotes: 1

Views: 1330

Answers (2)

Benno
Benno

Reputation: 2534

You can add a menu strip to the main form (parent), then make the menu strip invisible.

Upvotes: 0

Dr.Vista
Dr.Vista

Reputation: 139

i Solved it !!

simply add this line and disable any changes you made in the Properties window

Child.FormBorderStyle =(FormBorderStyle) BorderStyle.None;

seems like it's just a conflict error, but using codes instead of any properties Sloved the whole problem !!

Upvotes: 1

Related Questions