简体   繁体   English

调整面板中的表格大小不起作用

[英]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/ 功能区控件是在此处找到的控件: http : //nzlibbon.codeplex.com/

Instead I opted to do a different hack, stick with MDIParent and child relations and do the following : 相反,我选择了其他方法,坚持使用MDIParent和子级关系并执行以下操作:

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. 1)将菜单条添加到MDIParent窗体上,并将其Visible值更改为false 2)将MDIChild窗体上的以下内容更改为false:ControlBox,MaximizeBox,MinimizeBox,ShowIcon,ShowInTaskBar 3)将MDIChild窗体框架边框更改为无。

This allowed me to create a child window maximized without the title bar showing! 这使我可以创建一个最大的子窗口,而不会显示标题栏!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM