dotnet / dotnet/winforms

[Multi-Monitor][PerMonitorV2] ListBox with multiple items are not scaled well on 300% secondary monitor

Open
#8,269 0 comments 0 reactions 0 assignees View on GitHub
area-HDPI-PMv2
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

### .NET version

8.0.100-alpha.1.22567.28

### Did it work in .NET Framework?

Yes

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

No, it also repro on .NET 6.0 & 7.0.

### Issue description

ListBox with multiple items are not scaled well when move from 100% primary to 300% secondary monitor (AutoScaleMode = Dpi) under PermonitorV2 mode .

### Steps to reproduce

1. Launch VS instance on 100% primary monitor.
2. Create a winforms .net core project.
3. Add `PerMonitorV2` in csproj file.
4. Change AutoScaleMode = Dpi.
5. Drag and drop a ListBox control and add multiple items.
6. Build and run.
7. Move to 300% secondary monitor.

Or:

1. Extract and open [ListBox.zip](https://github.com/dotnet/winforms/files/10074229/ListBox.zip)on 100% primary screen.
2. Build and run it
3. Move to 300% secondary monitor.

**Actual result:**
ListBox control with multiple items displaying one less line when move from 100% primary to 300% secondary monitor.
100% primary monitor:
![image](https://user-images.githubusercontent.com/108860782/203503307-ef71a455-dabc-4415-a8c7-d8a32f1d0c1f.png)

Move to 300% secondary monitor:
![image](https://user-images.githubusercontent.com/108860782/203503989-ba2833fb-8ce2-40a7-a1e7-39312b0c142d.png)

**Expected result:**
ListBox control should scaled well.
100% primary monitor:
![image](https://user-images.githubusercontent.com/108860782/203503307-ef71a455-dabc-4415-a8c7-d8a32f1d0c1f.png)

Move to 300% secondary monitor:
![image](https://user-images.githubusercontent.com/108860782/203503307-ef71a455-dabc-4415-a8c7-d8a32f1d0c1f.png)

**More Info:**

1. This issue also repro on .NET7.0, .NET6.0.
2. This issue doesn't repro on .NET Framework.
3. This issue doesn't repro when AutoScaleMode = Font.
4. This issue doesn't repro on SystemAware and DpiUnware mode.

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.