原因:
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博客