Search code examples
c#winformspanel

resize form in panel not working


I am loading a form into a panel by using the below code, problem is if the main window is resized the form doesn't resize with it.

frm = new frmShopFloorMonitor();
            frm.TopLevel = false;
            frm.Dock = DockStyle.Fill;
            frm.AutoSize = true;
            pnlMain.Controls.Add(frm);
            pnlMain.Dock = DockStyle.Fill; 
            frm.Show();
            frm.BringToFront();

any suggestions?

The ribbon control is the one found here : http://officeribbon.codeplex.com/


Solution

  • Instead I opted to do a different hack, stick with MDIParent and child relations and do the following :

    1) Add a menu strip onto the MDIParent form and change its Visible value to false 2) Change the following on the MDIChild forms to false : ControlBox, MaximizeBox, MinimizeBox, ShowIcon, ShowInTaskBar 3) Change the MDIChild forms frame border to none.

    This allowed me to create a child window maximized without the title bar showing!