简体   繁体   English

通过屏幕分辨率调整控件的大小/位置

[英]Adjust Control's Size/Position With Screen Resolution

I have noticed that some applications change their controls position to adjust them as much as possible in the resolution as possible, If window is maximized they set themselves in such a way that over all GUI looks balanced. 我注意到有些应用程序会更改其控件位置,以尽可能地调整它们的分辨率。如果窗口最大化,它们将以一种在整个GUI上看起来平衡的方式进行设置。 My question is that is it possible to make or implement this functionality in Visual studio 2010 C#? 我的问题是可以在Visual Studio 2010 C#中实现或实现此功能吗?

Basically, you can place your controls in a TableLayoutPanel then 基本上,您可以将控件放在TableLayoutPanel然后

  • set its docking property to Left, Top, Right, Bottom 将其停靠属性设置为Left, Top, Right, Bottom
  • set all controls docking properties to Left, Top, Right, Bottom or less if more appropriate 将所有控件的停靠属性设置为Left, Top, Right, Bottom或更小(如果更合适)
  • set the columns and rows size of your TableLayoutPanel as "percent" or "fixed" at your convenience. 为方便起见,将TableLayoutPanel的列和行大小设置为“百分比”或“固定”。

Take a look at that walkthrough . 看看那个演练 It's not easy to implement at the first time, but go through the whole tutorial and you'll get a good idea on how to do it. 第一次实现起来并不容易,但是要遍历整个教程,您将对如何实现有个好主意。

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

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