简体   繁体   English

在winForms c#中以全屏模式创建具有多个部分的面板

[英]Create a panel in winForms c# with multiple sections in full screen mode

I would like to create a form that can have multiple panels with a single picturebox in each panel and each panel can be moved around. 我想创建一个窗体,该窗体可以具有多个面板,每个面板中只有一个图片框,并且每个面板都可以移动。

The panels need to fit on the maximum size of the monitor with each panel having equal width. 面板需要适合显示器的最大尺寸,并且每个面板的宽度相等。

I have tried to get the form to start at the maximum size using the WindowState Property but cannot get the panels' width to be split depending on the number of panels that are there. 我试图使用WindowState属性使表单以最大尺寸开始,但是无法根据面板的数量来拆分面板的宽度。

Also, I have tried to use a flow-panel as the main container and tried adding panels as required inside the flow-panel. 另外,我尝试使用流面板作为主要容器,并尝试根据需要在流面板内部添加面板。 The flow-panel is docked as "fit" in the form. 流量面板以“适合”的形式停靠在表格中。

Can someone please explain how I can solve this problem? 有人可以解释我如何解决这个问题吗?

Thank you in advance, 先感谢您,

Varun 瓦伦

Edit: The form also needs to be able to let the user move the pictures in the picturebox around. 编辑:该窗体还需要能够使用户在图片框内四处移动图片。

You can add splitContainers, that are 2 panels, and inside each panel you can add another split container, and then again and again... 您可以添加splitContainers,它是2个面板,并且在每个面板内可以添加另一个split容器,然后一次又一次...

To make panels fit on the maximum size of the form you'll have to use dock propery = fill or anchor it to top, right, bottom and left 为了使面板适合表格的最大尺寸,您必须使用固定底座=将其填充或固定在顶部,右侧,底部和左侧

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

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