dotnet / winforms

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

[PermonitorV2] [SystemAware] The default ImageIcon in ToolStrip is not scaled well on 300% primary screen with app created on 100% DPI #8247

Open Amy-Li03 opened 1 year ago

Amy-Li03 commented 1 year ago

.NET version

.NET 8.0.100-alpha.1.22565.7

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

The default ImageIcon in ToolStrip is smaller than Text on 300% primary screen with app created on 100% DPI under PermonitorV2/SystemAware modes. image

The default ImageIcon in ToolStrip is larger than Text on 100% primary screen with app created on 300% DPI under DpiUnware/PermonitorV2/SystemAware modes. image

Steps to reproduce

  1. Launch VS instance on 100% primary screen.
  2. Create a WinForms .NET core project.
  3. Add <ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode> in csproj file.
  4. Drag and drop a ToolStrip to form designer.
  5. Then insert standard items for MenuStrip/ToolStrip via clicking ‘Insert Standard Items’ in controls’ Tasks panel.
  6. Close this project.
  7. Launch VS instance on 300% primary screen.
  8. Build and run.

Or:

  1. Extract and open TestApp.zip on 300% primary screen.
  2. Build and run it.

Actual result: The default ImageIcon in ToolStrip is smaller than Text on 300% primary screen. image

Expected result: The default ImageIcon in ToolStrip should be scaled well on 300% primary screen. image

More info:

  1. This issue repro on PermonitorV2/SystemAware modes when app created on 100% DPI and run app on 300% DPI and it doesn't repro on DpiUnware mode.
  2. This issue repro on DpiUnware/PermonitorV2/SystemAware modes when app created on 300% DPI and run app on 100% DPI.
dreddy-work commented 1 year ago

@drago-draganov , thanks 👍 .