dotnet / dotnet/winforms

[Multi-Monitor] The controls' size and location are not scale well when move form from 300% main screen to 100% secondary screen system DPI.

Open
#6,226 0 comments 0 reactions 0 assignees View on GitHub
area-HDPI-PMv2
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

* .NET Core Version:
.NET SDK 7.0.100-alpha.1.21568.2

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

**Problem description:**

The controls' size and location are not scale well when move form from 300% main screen to 100% secondary screen system DPI.

Launch on 300% main screen.
![300](https://user-images.githubusercontent.com/45864985/143391476-e2a489b2-8bcf-4b9f-be05-b1e0f10d312f.png)

Move to 100% secondary screen.
![100](https://user-images.githubusercontent.com/45864985/143391492-7015078c-b58b-47b3-b6c1-b5ee0b975de6.png)

**Expected behavior:**

The controls' size and location should be scaled well.

**Minimal repro:**

1. Set the main screen as 300% DPI, and second screenshot as 100% DPI.
2. Open the [CoreHDPITesting2.zip](https://github.com/dotnet/winforms/files/7600724/CoreHDPITesting2.zip) app on 300% main screen.
3. Change the ApplicationHighDpiMode to PerMonitorV2 in .csproj file and set AutoScaleMode = None for Form1 designer.
4. Run it on 300% main screen, then move Form1 to 100% secondary screen.

**More Info:**

1. This issue doesn't reproduce under SystemAware and DpiUnAware modes.
2. The scale issue occurs when move from 100% main screen to 300% secondary screen too.
Launch on 100% main screen.
![100-2](https://user-images.githubusercontent.com/45864985/143391420-b3edb425-454a-482f-80cf-3206708c8449.png)

Move to 300% secondary screen
![300-2](https://user-images.githubusercontent.com/45864985/143391444-7dfbc97d-a96a-4d5a-a02e-ba26430a3948.png)
.

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.