Closed frobijn closed 1 month ago
@Olina-Zhang can your team please confirm this issue?
@elachlan @frobijn this issue is about the Anchor property, which can resolved by adding the System.Windows.Forms.AnchorLayoutV2": true
in the ControlScalingBug.runtimeconfig.json file a below screenshot. please have a try.
Refer the workaround from https://github.com/dotnet/winforms/issues/10382#issuecomment-1859448756
Yes, that solves the issue. The option "System.Windows.Forms.AnchorLayoutV2" as a solution to problems with anchoring is impossible to find with a search engine, so it doesn't exist :-)
.NET version
8.0
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes: see https://github.com/dotnet/winforms/issues/6381.
Issue description
Issue #6381 is back. The issue is present when the form is first displayed; resizing afterwards works as expected.
Steps to reproduce
The issue #6381 contains a demo program. That doesn't work correctly with .NET 8. Its behavior is even worse if
is added. I've also added
to the project file as adviced in https://github.com/dotnet/winforms/blob/main/docs/designer/designer-high-dpi-mode.md and opened the forms in the designer, but that did not have any effect.
Updated demp program: ControlScalingBug_Net8.zip
Application behavior on the high-DPI main monitor: https://github.com/dotnet/winforms/assets/13610628/882c12fb-c8df-4bfa-8198-dbb118ed09c8
Application behavior on the normal-DPI secondary monitor: https://github.com/dotnet/winforms/assets/13610628/b4ba58ab-2e04-41a8-8e3b-ad8a5bf6e4fe