表单在另一台计算机上看起来不同

编程入门 行业动态 更新时间:2024-10-27 16:34:28
本文介绍了表单在另一台计算机上看起来不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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

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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-27 11:11:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1154191.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   机上   另一台

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!