dotnet / dotnet/winforms

[Multi-Monitor] The Height of currentDPILabel's size has a little change when DPIs differ

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

Description

* .NET Core Version:
.NET SDK 6.0.100-preview.6.21313.2 + private binaries build from main branch in dotnet/winforms repo [Private dlls.zip](https://github.com/dotnet/winforms/files/6654027/Private.dlls.zip)

* Have you experienced this same bug with .NET Framework?:
No

**Problem description:**

The Height of currentDPILabel's size has a little change after moved form from 300% primary screen to 100% secondary screen.

Open on 300% primary screen.
![300](https://user-images.githubusercontent.com/45864985/122020256-32554f80-cdf7-11eb-88d6-685b49bb0184.png)

Moved to 100% secondary screen.
![Move-300-to-100](https://user-images.githubusercontent.com/45864985/122020268-341f1300-cdf7-11eb-920b-4fa0e0c16521.png)

**Expected behavior:**

The Height of currentDPILabel's size should be same with the without private dlls result after moved form from 300% primary screen to 100% secondary screen.

Open on 300% primary screen.
![300](https://user-images.githubusercontent.com/45864985/122020839-b1e31e80-cdf7-11eb-97fa-9b1d727c1f2a.png)

Moved to 100% secondary screen.
![Move-300-to100](https://user-images.githubusercontent.com/45864985/122020855-b3ace200-cdf7-11eb-82a0-8790cee5ae13.png)

**Minimal repro:**

1. Set the primary screen as 300% DPI, and second screenshot as 100% DPI.
2. Open and run the test app [PerMonitorHDPCore.zip](https://github.com/dotnet/winforms/files/6654080/PerMonitorHDPCore.zip) on the 300% primary screen.
3. Move the **PerMonitor Demo1** form to 100% DPI second screen, and check the Height value of currentDPILabel's size.

**More info:**

1. Just repro in PerMonitorV2 mode with Form's AutoScaleMode: Font, cannot repro Form's AutoScaleMode: DPI.
2. Cannot repro in SystemAware mode, since this issue is in secondary screen.
3. Cannot repro in without privates.

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.