dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.28k stars 956 forks source link

[HDPI] TextBox shrinks when running application on 300% DPI #5112

Open Zheng-Li01 opened 3 years ago

Zheng-Li01 commented 3 years ago

Problem description: TextBox shrinks after running application on 300% DPI. image

Expected behavior: TextBox was scaled well when running application on 300% DPI.

Minimal repro:

  1. Set Windows DPI as 300%,.
  2. Open the attached application. WinFormsApp3.zip
  3. Build and run it.
  4. Observe the size of TextBox.
dreddy-work commented 3 years ago

Some winforms controls are Font scaled and reset control height to Font height, no mater what the bounds were. Expecting different category controls to align with each other when scaled is a complex issue. This needs breaking changes.

merriemcgaw commented 3 years ago

@Zheng-Li01 Does it behave as expected when everything is using DPI Scaling?

Zheng-Li01 commented 3 years ago

@merriemcgaw, there have same behavior between design time and run time when creating & running the project both on 300% DPI scaling. image

Zheng-Li01 commented 3 years ago

@merriemcgaw, the issue also can reproduce when setting the AutoScaledMode property value as DPI. image

merriemcgaw commented 3 years ago

@Zheng-Li01 Thanks!

RussKie commented 2 years ago

Planning to confirm with the Widows team on expected behaviors.