winforms icon indicating copy to clipboard operation
winforms copied to clipboard

[HDPI] SystemAware - wrong Form.ClientSize with DPI other than 100%

Open kirsan31 opened this issue 1 year ago • 0 comments

.NET version

8.0.7

Did it work in .NET Framework?

No

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Behavior is identical with .Net versions from 5.0 to 8.07. .NET Framework 4.8. have similar issues but size error is smaller.

Issue description

SystemAware (or PerMonitorV2 starting scale) will calculate wrong Form.ClientSize for dpi more than 100%. The problem was discovered in https://github.com/dotnet/winforms/issues/12132#issuecomment-2382306850. See screenshots. net48 net807

Steps to reproduce

WinForms_DPI_SystemAware.zip

kirsan31 avatar Oct 04 '24 09:10 kirsan31