根据屏幕分辨率控制调整大小
我有面板控制。更多控件位于面板中。我将面板的停靠属性设置为“填充”。面板根据屏幕分辨率调整大小。但控件保持不变。面板中的控件不会根据屏幕解决方案调整大小。
我在同一页面中有更多标签、面板、文本框和按钮。
如何设置停靠属性以根据屏幕分辨率调整页面中所有控件的大小?
感谢您的帮助
I have panel control. More controls are in panel.I set the dock property for panel as 'fill' .The panel are resized based on screen resolution. but the controls remains same.The controls in the panel are not resized based on screen solution.
i have more labels and panels and text-boxs and button in the same page.
How to set the dock property to resize all controls in page based on screen resolution?
Thanks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用
Anchor
属性并将控件锚定到所有 4 个边。Use the
Anchor
property and anchor the control to all 4 sides.我希望这个解决方案(取自此处) 将帮助在客户端屏幕分辨率发生变化时显示表单内的所有控件:
I hope this solution (drawn from here) will help display all the controls inside the form when the screen resolution changes at the client side:
除了设置容器Panel的Dock属性外,还必须设置Panel内控件的Anchor或Dock属性。通常,当表单上有多个控件时,添加 TableLayoutPanel、FlowLayoutPanel 甚至另一个面板都会有所帮助。
In addition to setting the Dock property of the container Panel, you also have to set the Anchor or Dock properties of controls within the Panel. Usually, adding a TableLayoutPanel, FlowLayoutPanel, or even another Panel will help when you have multiple controls on a Form.