Repository navigation
Revert "Fix GroupBox Standard and Popup layout overlap when switching to NET11 visual styles (#14891)" - #15069
Conversation
… to NET11 visual styles (dotnet#14891)"
There was a problem hiding this comment.
🟡 Changes recommended
There’s at least one concrete fixable issue (avoidable InstalledFontCollection creation in Semibold lookup) and the PR description should be updated to accurately reflect the behavioral changes included.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Reverts a prior GroupBox modern-visual-styles change and updates the modern renderer’s layout/rendering metrics, caption font behavior, and related tests/docs to match the reverted (or re-established) behavior.
Changes:
- Adjust modern
GroupBoxlayout insets for Standard/Popup/Flat, including Popup header sizing and caption positioning. - Update modern caption font behavior (scale factor for non-Flat, optional installed Semibold face selection) and text-scale layout remeasurement.
- Align unit tests and XML docs with the updated modern renderer behavior.
File summaries
| File | Description |
|---|---|
| src/test/unit/System.Windows.Forms/System/Windows/Forms/GroupBoxTests.cs | Updates renderer/layout tests to match new Standard/Popup metrics, caption font behavior, and layout invalidation expectations. |
| src/System.Windows.Forms/System/Windows/Forms/Rendering/ModernControlVisualStyles.cs | Adds modern GroupBox metric constants (caption scale, insets/padding). |
| src/System.Windows.Forms/System/Windows/Forms/Controls/GroupBox/GroupBox.Modern.cs | Revises modern padding calculations and popup rendering; adds Semibold face lookup + caching; changes text-scale relayout behavior. |
| src/System.Windows.Forms/System/Windows/Forms/Controls/GroupBox/GroupBox.FlatStyle.Docs.cs | Updates docs to describe the modern visual appearance and layout behavior changes. |
| src/System.Windows.Forms/System/Windows/Forms/Controls/GroupBox/GroupBox.cs | Refactors classic DisplayRectangle calculation to inline font-height caching logic. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15069 +/- ##
=============================================
Coverage 37.24166% 37.24166%
=============================================
Files 246 246
Lines 9774 9774
Branches 1029 1029
=============================================
Hits 3640 3640
Misses 5970 5970
Partials 164 164
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
KlausLoeffelmann
left a comment
There was a problem hiding this comment.
Yep, looks good!
Please merge it as soon as you got a minute, so I can update my local main, and see, if I want tweak the caption-size a bit down.
Thanks!
This reverts commit 69aa55b
Before changes:

After Changes:
