Commit 69aa55b
authored
Fix GroupBox Standard and Popup layout overlap when switching to NET11 visual styles (#14891)
## Root Cause
`GroupBox` used larger NET11 caption/header metrics for `DisplayRectangle` in `FlatStyle.Standard` and `FlatStyle.Popup`.
After switching from Classic to NET11, the content rectangle moved, but existing child controls kept their positions. This made controls near the top overlap the GroupBox header/border.
## Proposed changes
Update modern GroupBox rendering and layout so that:
- Preserve Classic layout metrics for Standard and Popup GroupBoxes in NET11 mode.
- Preserve caption font settings while respecting system text scaling.
- Keep the modern Popup appearance with an accent-colored header and border.
- Leave Flat GroupBox behavior unchanged.
- Add regression tests and update documentation.1 parent d66f735 commit 69aa55b
7 files changed
Lines changed: 328 additions & 283 deletions
File tree
- docs
- src
- System.Windows.Forms/System/Windows/Forms
- Controls/GroupBox
- Rendering
- test/unit/System.Windows.Forms/System/Windows/Forms
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
187 | 188 | | |
188 | 189 | | |
189 | 190 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | | - | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | | - | |
214 | | - | |
215 | | - | |
| 213 | + | |
| 214 | + | |
216 | 215 | | |
217 | 216 | | |
218 | 217 | | |
| |||
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
0 commit comments