Windows 窗体 .net 框架中的控件已移位
我有一个奇怪的问题。我用 C# 和 .net Framework 3.5 设计了一个 Windows 窗体应用程序。在运行时,表单及其控件在所有计算机上都很好,除了我的笔记本电脑,其中控件不在正确的位置。
如果我在笔记本电脑上从头开始设计表单并定位正确,则会导致其他计算机的形状无效。
我的努力:
- 如果我在安全模式下运行窗口,表单大小和控件位置 是正确的。
- 我已经卸载了视频驱动程序并使用默认的 Windows 版本,但问题仍然存在。
- 我使用了不同的框架,如 2.0 和 4.0,以及不同的 Visual Studios 版本,它们都有相同的问题。
- 实际上所有公司的所有.net框架产品都表明了同样的问题。
我的电脑设置: 戴尔 1557 Studio 笔记本电脑 显卡 ATI Radeon HD 4500
I have a strange problem. I have designed a windows form application in c# and .net framework 3.5. In the runtime, the form and its controls are fine in all the computers except my laptop, where the controls are not in the correct positions.
If I design the form from scratch on my laptop with correct positioning it will result in an invalid shape for other computers.
My efforts:
- If I run the windows in Safe Mode the form size and control positions
are correct. - I have uninstalled the Video Driver and used default windows version but the problem still persists.
- I used different frameworks like 2.0 and 4.0, and different Visual Studios versions and they all have the same problems.
- Actually all the .net framework product from all the companies indicate the same issue.
My computer Settings:
Laptop 1557 Studio DELL
Graphic ATI Radeon HD 4500
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当文本大小人为增加到 125% 时,放置得相当近的文本和控件将环绕表单并将所有内容向下/向下推。如果这是您打算支持的功能,您只需重新设计表单来处理您想要支持的不同放大级别,并在应用程序中测试这些放大文本模式,直到您对其外观感到满意为止。这不是您可以严格控制的事情,因为增加文本大小是一项辅助功能。
When the text size is artificially increased to 125% text and controls that are rather closely placed will wrap around the form and push everything down/over. If this is something you intend to support, you'll simply have to redesign your form to handle the different enlargement levels you care to support and test those enlarged text modes in your app until you're satisfied with their appearance. It's not something you can strictly control, since increased text size is an accessibility feature.
我认为这是由于屏幕分辨率差异造成的。我相信在这两种情况下,控件的实际位置是相同的,在一种情况下,屏幕“更大”,因此您的控件出现在屏幕上的不同位置。
尝试设计要处理的表单Windows CE 上的不同分辨率和宽高比
您可以(并且应该)做的另一件事是使用 WPF,这是构建 Windows 用户界面的新方法。
I assume it is due to a screen resolution differences. I believe that the actual location of the controls is identical in both cases, in one the screen is "larger" and therefor your controls appear in a different position on the screen.
try Designing forms to work on different resolutions and aspect ratios on Windows CE
Another thing you can (and should) do is work with WPF, which is the new way to build user interfaces for windows.
我刚刚找到了解决方法。
在 Windows 7 的显示设置中,我将文本大小从 125% 更改为 100%。一切都变小了,但位置和尺寸都准确。
仍然想知道它是如何工作的!
I've found a workaround just now.
In the display settings of Windows 7 I have changed the Text size from 125% to 100%. Everything is smaller but in accurate positions and sizes.
Still wondering how it works!!