大显示文本移动控件
我正在开发 .Net Windows 应用程序。所有控件都排列得很好,但是当用户将其 Windows 显示文本指定为大于 Windows 7 默认值“较小”时,控件会在窗体上移动并使其无法使用。
无论显示文本设置如何,是否有办法锁定这些控件?
I'm working on a .Net Windows application. All the controls arrange fine, but when the user specifies their Windows display text to be larger than the Windows 7 default of 'Smaller', the controls get moved around on the form and makes it unusable.
Is there a way to lock down those controls no matter what the display text setting is at?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的问题的解决方案是使用WPF 因为这是与分辨率无关的。
解决此问题的解决方法是在各种不同的文本大小和屏幕分辨率配置中测试您的应用,并在标准大小的所有内容周围留出足够的空间,以便在用户调整大小。
The solution to your problem is to use WPF as this is resolution independent.
Your workaround to the problem is to test your app in various different configurations of text size and screen resolution and put enough space around everything in standard size so that it still fits when the user resizes.
除了字体大小之外,还有很多因素可以移动控件。如果有什么东西正在移动您的控件,那是因为需要阅读或显示文本,“锁定”控件将无济于事。
您必须编写应用程序,以便将控件大小考虑在内。还有另一个问题解释了这一点。
There are many things other than font sizes that can move your controls around. If something is moving your controls around, it is because it is necessary to read or display the text, "locking down" the controls will not help.
You have to write your app so it takes control sizes into account. There is another SO question that explains this.