dotnet / dotnet/winforms

Anchoring issue on multi-monitor setup using HDPI PerMonitorV2

Open
#11,516 2 comments 1 reaction 0 assignees View on GitHub
area-Anchor/Scaling area-HDPI-PMv2 area-MDI
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### .NET version

.NET 9.0 Preview 4

### Did it work in .NET Framework?

Yes

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

This worked in NET 6.

### Issue description

When moving the MDIParent from a 100% monitor to a 150% monitor, widening the form, closing frmNameList, then opening a new form (File -> Names), the new form is not laid out correctly. The PictureBox Custom Control is too far to the left, but was anchored Top, Right. The ListView control is too wide and overlaps with the controls to the right of it.

https://github.com/dotnet/winforms/assets/2184698/a41be26a-ba6f-48a2-b452-d78005e1631f

### Steps to reproduce

1. Run the project on a 100% monitor.
2. Move the MDIParent to a 150% monitor.
3. Make MDIParent wider
4. Close frmNameList then re-open it under the menu option File -> Name.
5. On the new form, the PictureBox Control is positioned too far to the left and inside the listview. The regular PictureBox that is not a custom control is positioned properly.
6. The ListView control is too wide and overlaps with all of the controls to the right of it.

[AnchorIssue.zip](https://github.com/user-attachments/files/15779847/AnchorIssue.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.