开发笔记(20211010)—Visual Studio非DPI感知模式启动

本文介绍了在高DPI环境下,由于显示DPI差异导致的Visual Studio Windows Forms设计器布局问题。解决方案是通过设置注册表项禁用Visual Studio的HighDPI意识,以确保在96 DPI下进行布局计算,从而解决设计界面变形的问题。
摘要由CSDN通过智能技术生成

原因:

With the extreme differences in display DPIs, especially in modern 2-in-1 devices, this can still happen with the most current versions of the .NET Framework and Visual Studio. To address this in a team using different DPI displays, make sure Visual Studio always starts in a non-DPI-aware mode, so the Windows Forms designer always bases the layout calculation on 96 DPI. To this end, simply set the following registry key to disable Visual Studio's HighDPI awareness

由于显示DPI的极端差异,尤其是在现代2合1设备中,这种情况在最新版本的.NET Framework和Visual Studio中仍可能发生。 要在使用不同DPI显示的团队中解决此问题,请确保Visual Studio始终以非DPI感知模式启动,因此Windows窗体设计器始终将布局计算的基础设置为96 DPI。 为此,只需设置以下注册表项即可禁用Visual Studio的HighDPI意识:

解决方法:

注册表中添加项

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe]

"dpiAwareness"=dword:00000000

以上内容复制自解决VS在高DPI下设计出的Winform程序界面变形问题_weixin_34275734的博客-CSDN博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

闷头挣钱

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值