dotnet / dotnet/winforms

[Multi-Monitor] Buttons don't scale well on the secondary monitor when their font property is a non-default setting

Open
#9,239 0 comments 0 reactions 1 assignee Claimed by @ricardobossan 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 version

.NET 8.0.100-preview.6.23306.2

### Did it work in .NET Framework?

No

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

No, it doesn't work in .NET 6.0/7.0/8.0, not a regression issue.

### Issue description

Testapp: [testfontapp.zip](https://github.com/dotnet/winforms/files/11675107/testfontapp.zip)

https://github.com/dotnet/winforms/assets/86937911/6515ca51-ce5d-4bb8-8761-0922055e6df9

100%DPI:
![image](https://github.com/dotnet/winforms/assets/86937911/4ee1ecee-7ad1-44dc-a1c6-f1e83607d926)

100% primary monitor -> 300% secondary monitor
![image](https://github.com/dotnet/winforms/assets/86937911/31ce4092-4356-4503-a3ab-e8329cc24c04)

This issue does not repro when move from 300% primary monitor to 100% secondary monitor.

https://github.com/dotnet/winforms/assets/86937911/31b371f7-5bf4-4186-bcbb-775ee2eef05a

This issue also repro's on design time.

https://github.com/dotnet/winforms/assets/86937911/1900a7d9-0c5b-49cf-823f-3b6f91e58b0a

### Steps to reproduce

1. Launch VS instance on 100% primary monitor.
2. Add `PerMonitorV2` in csproj file.
3. Close and reopen Solution.
4. Add some buttons with different font properties to form designer.
5. Set buttons AutoSize property as true. (It's a necessary step)
6. Build and run the application.
7. Move to 300% secondary monitor.

**More Info:**
1. This issue also repro's on design time.
2. This issue does not repro when their font property is a default setting.
3. This issue does not repro when move from 300% primary monitor to 100% secondary monitor.
4. This issue only repro on `PerMonitorV2` application 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.