question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Groupbox incorrectly scale on the high DPI devices when AutoScaleMode is set to DPI

See original GitHub issue

.NET version

.Net 6

Did it work in .NET Framework?

Yes

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

No

Issue description

The WinForm dialog display incorrectly in the high DPI(>100%) see the screenshot: displayError This is the correct display: displayCorrectly But if I add a Font = Font or Scale(new SizeF(1.0F,1.0F)) to the end of InitializeComponent, we can get the right display again: DisplayCorrectlyAfterFix

So why do I need the extra code to make it display correctly? We just migrated our code to .net 6 from .net 4.8. There are no these situations on the .net framework 4.8. Did we have any solution to handle this on the high DPI?

Steps to reproduce

Create a new WinForm project (.net 6) Use a groupbox, and fill in some checkboxes. Set the dialog’s AutoScaleMode to Dpi. Building. Set the system Scale to 200% (system settings ->Display -> Scale and layout). Open the new exe.

Issue Analytics

  • State:open
  • Created 3 months ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Amy-Li03commented, Aug 2, 2023

@dreddy-work verified the sample DocumentDriller in .NET 8.0 latest build 8.0.100-rc.1.23401.24, for both DPI and Font modes on 100% & 300% DPI, at run time, the ComboBox display well as it was in design time. Following is the repro video: Test app: WinFormsApp57.zip 100%DPI 300%DPI

1reaction
dreddy-workcommented, Jun 19, 2023

@hmisaki, Our objective is to enhance the overall user experience in .NET Core when utilized with high DPI devices. This is particularly relevant for SystemAware (default mode) applications, and it aligns with the priority of our ongoing work in WinForms. Regarding the release schedule, I will provide an update once we complete the initial investigation and have a clear understanding of the extent of the required fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Windows Forms DPI scaling
Creating a DPI-Aware Application. All containers must use the same AutoScaleMode - this part fixed my problem. It is required that windows ...
Read more >
Fix DPI display issues in Windows Form Designer - Visual ...
In the Options dialog, choose Windows Forms Designer > General, and set DPI Scaling Notifications to False. Troubleshoot. If the DPI-awareness ...
Read more >
Developer view crisp / Runtime blurry
When AutoScaleMode is set to “DPI”, my runtime button's font looks just a little bit blurry. With the form's “WindowState” set to ...
Read more >
RadPageView: incorrect scaling of anchored controls inside a ...
Hello,. At the core of the problem is using: this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;. This will disable scaling logic and ...
Read more >
WinForms Scaling at Large DPI Settings–Is It Even Possible?
Let's dive into the specifics of high DPI and try to understand different problems that high DPI displays cause, and how to address...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found