-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Scale the Anchor editor according to DPI #13853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scale the Anchor editor according to DPI #13853
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the DPI scaling issue in the AnchorEditor component by replacing hard-coded pixel values with DPI-scaled equivalents. The Anchor editor in PropertyGrid now properly scales on high DPI environments instead of appearing too small at 300% DPI.
Key changes:
- Replace hard-coded pixel values (10, 30, 40, 60, 90) with DPI-scaled equivalents using
ScaleHelper.ScaleToInitialSystemDpi()
- Update all UI element positioning and sizing to use the scaled values
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13853 +/- ##
===================================================
+ Coverage 77.10742% 77.12180% +0.01437%
===================================================
Files 3273 3273
Lines 644925 644924 -1
Branches 47692 47693 +1
===================================================
+ Hits 497285 497377 +92
+ Misses 143967 143873 -94
- Partials 3673 3674 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
69f453d
to
8b7f313
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Do we need to bring this changes over to the OOP Designer?
Yes, I have submitted a PR https://github.com/microsoft/winforms-designer/pull/6459 in OOP designer, please review it. |
Related #13830
Proposed changes
InitializeComponent
method to draw the Anchor Editor using the scaled size instead of hard-coding it.Customer Impact
Regression?
Risk
Screenshots
Before
In 300% DPI:

After
In 300% DPI:

Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow