如何修复Windows 11

发布于 2025-02-01 12:35:43 字数 151 浏览 4 评论 0原文

我有一个C#桌面应用程序,该应用程序是在DOT Net Framework 4.6.2中开发的。该应用程序在Win 10中工作。但是,当Win 11中运行相同的应用程序时,所有表单控件都会受到干扰。就像很少的按钮完全隐藏了。有全球修复吗?我不想重新定位并重新调整整个应用程序的表单和控制。

I have a C# desktop application which is developed in dot net framework 4.6.2. This application is working finr in Win 10. But when same application is run in Win 11, all form controls are disturbed. Like few buttons are totally hidden. Is there any global fix? I don't want to reposition and resize the forms and controlls again for the whole application.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晌融 2025-02-08 12:35:43

您遇到的问题是因为Windows 11计算机具有不同的屏幕DPI设置。众所周知,Winforms在扩展100%以外的任何设置方面都很糟糕。如果您无法一直运行100%,那么您将必须执行一些编码魔术来检测DPI设置并调整保证金和填充...或者您可以在WPF中重做UI,该UI在任何设置下都能正确缩放。

如果您重建.NET 4.7+:

https://learn.microsoft.com/en-us/dotnet/desktop/winform/winforms/high-dpi-dpi-suppor-support-in-windows-forms-forms--forms-forms--forms--forms? 4.8

The issue you have is because the Windows 11 computer has a different screen DPI setting. Winforms is notoriously bad at scaling with any setting other than 100%. If you cannot run 100% all the time, then you will have to do some coding magic to detect DPI setting and adjust margins and padding... Or you could redo your UI in WPF, which scales properly at any setting.

Some possible avenues to explore if you rebuild to .NET 4.7+:

https://learn.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文