表单在另一台计算机上看起来不同 [英] Form Looks Different on Another Computer

查看:28
本文介绍了表单在另一台计算机上看起来不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的机器上构建表单时,它看起来不错,但是当它在不同的计算机上编译时,表单本身的大小是错误的.标签四处移动,内容不再正确对齐.

When I build my form on my machine it looks fine, but when it is compiled on a different computer the size of the form itself is wrong. Labels are moved around and things are no longer aligned properly.

我如何保证所有内容在任何计算机上看起来都一样?

How do I guarantee that everything will look the same on any computer?

我尝试将 AutoScaleMode 设置为 none,它有所帮助,但随后标签部分位于相应的文本框下方.

I tried setting AutoScaleMode to none, and it helped a bit but then the labels were partially underneath the corresponding text boxes.

推荐答案

字体或 DPI 不同.

Either the font or the DPI differ.

而且我从来没有真正找到一种方法来表达 AutoScaleMode =(最合适的字体或 dpi).

And I've never really found a way to say AutoScaleMode = (most appropriate of font or dpi).

但是试试AutoScaleMode = DPIAutoScaleMode = Font.其中一个应该可以工作.

But try AutoScaleMode = DPI and AutoScaleMode = Font. One of them should work.

我们从来没有找到一种可靠的方法来处理这个问题.我们的工作场所曾经在所有工作站上强制执行 DPI,但此后发生了变化.处理它的最佳方法是确保使用 FlowLayoutPanel 或 TableLayoutPanel 来布局控件,而不是控件的绝对定位.

We never found a reliable way to handle this. Our workplace USED to enforce the DPI on all workstations, but that has since changed. The best way to handle it is to make sure you layout your controls with FlowLayoutPanel or TableLayoutPanels instead of absolute positioning of controls.

这篇关于表单在另一台计算机上看起来不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆