简体   繁体   English

如何避免Winform自动调整大小导致控件裁剪?

[英]How to avoid Winform auto resize resulting in controls cropped?

I created a Form with fixed size, containing a fixed sized TableLayoutPanel . 我创建了一个具有固定大小的Form ,其中包含一个固定大小的TableLayoutPanel Controls are anchored to the TableLayoutPanel using the Anchor property. 使用Anchor属性将控件锚定到TableLayoutPanel However controls are cropped after moving from Desktop to laptop. 但是,从台式机移动到笔记本电脑后,控件将被裁剪。

I have tried setting MinimumSize , AutoSize and AutoSacling in Form and TableLayoutPanel , but controls are still cropped. 我尝试在FormTableLayoutPanel设置MinimumSizeAutoSizeAutoSacling ,但是控件仍然被裁剪。

Suggestions? 建议?

You should try using Dock property of TableLayoutPanel. 您应该尝试使用TableLayoutPanel的Dock属性。

Change its value to fill (Dock = Fill), this way your TableLayoutPanel will be drawn within the form border. 更改其值以填充(Dock = Fill),这样您的TableLayoutPanel将被绘制在表单边框内。

Another suggestion is, you should divide your main tablelayouttable like a grid and put one control inside its individual cell. 另一个建议是,您应该像网格一样划分主表布局,然后将一个控件放入其单个单元格中。 Set their Dock property to Fill and you will see the result. 将其Dock属性设置为Fill,您将看到结果。

Hope it helps. 希望能帮助到你。 Good Luck. 祝好运。

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

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