Skip to content

[Breaking change]: Update Anchor Layout to support high DPI machines. #32145

@dreddy-work

Description

@dreddy-work

Description

In .NET 8.0 Preview 1, Control anchor computations changed to support high dpi devices. Detailed documentation on changes is available here: https://github.com/dotnet/winforms/blob/main/docs/design/anchor-layout-changes-in-net80.md

Version

.NET 8 Preview 1

Previous behavior

Certain applications with SystemAware or PermonitorV2 aware mode and anchored controls were facing issues with layout on high dpi devices.

New behavior

Applications with SystemAware or PermonitorV2 aware mode and anchored controls should have better layout when rendered on high dpi devices.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.

Reason for change

We have been improving the user experience for WinForm on high Dpi monitors. This change is enabling the developers to use anchored layout for the applications on high dpi devices.

Recommended action

If user wanted to opt-in to this new behavior, they could do so by setting System.Windows.Forms.AnchorLayoutV2 to true in runtimeconfig.json file as defined here

Feature area

Windows Forms

Affected APIs

No response


Associated WorkItem - 60094

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 8Work items for the .NET 8 release📌 seQUESTeredIdentifies that an issue has been imported into Quest.binary incompatibleExisting binaries may encounter a breaking change in behavior.breaking-changeIndicates a .NET Core breaking change

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions