dotnet / dotnet/winforms

[HDPI] SystemAware controls inside containers anchored with Bottom or Right are messed up.

Open
#14,034 4 comments 0 reactions 0 assignees View on GitHub
area-Anchor/Scaling area-HDPI
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

### .NET version

.Net9

### Did it work in .NET Framework?

Not tested/verified, but I think - NO.

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

Not working with .Net8, and I think with oldest too.

### Issue description
Form designed and launched with 125% dpi:
Image

If `AnchorStyles.Bottom` is used then problems are more huge:
Image

Image

This is one of more others issues with anchoring Bottom / Right and HDPI:
https://github.com/dotnet/winforms/issues/5076
https://github.com/dotnet/winforms/issues/8157
https://github.com/dotnet/winforms/issues/10958
https://github.com/dotnet/winforms/issues/11516
...

Setting:
```json
{
"configProperties": {
"System.Windows.Forms.AnchorLayoutV2": true
}
}
```
in `runtimeconfig.template.json` will solve the issues.

### Steps to reproduce

[TabControlAnchorBug.zip](https://github.com/user-attachments/files/23449795/TabControlAnchorBug.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.