Group Box is not rendering correct
See original GitHub issue- .NET Core Version: .net 6
- Windows version: Windows 11 Version 22H2 Build 22621.674
- Does the bug reproduce also in WPF for .NET Framework 4.8?: I dont know
Problem description:
Group Box is rendering wrong.
Source Code:
<Window x:Class="MyProgram.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Main Window"
Height="720" Width="1280"
MinHeight="720" MinWidth="1280"
WindowStartupLocation="CenterScreen" Icon="icon.ico"
WindowStyle="ThreeDBorderWindow" ResizeMode="CanResize">
<Grid>
<GroupBox BorderThickness="5" BorderBrush="Red" Margin="50"/> // BorderThickness >= 13 looks normal
</Grid>
</Window>
Expected behavior:
Group Box is rendering correctly
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Sub-Classed Groupbox does not properly draw the contents
This is a known issue when owner-drawing a container that stores a control collection like a GroupBox ? What I'm missing to do...
Read more >Groupbox rendering issue
I have a weird issue with the rendering of the GroupBox, I Created a custom skin, and changed the Group panel images in...
Read more >Question - change the style of the group box
How can I change the style of the groupbox exactly like what you see in the picture? Similar to the part I highlighted...
Read more >GroupBoxRenderer Class (System.Windows.Forms)
Provides methods used to render a group box control with or without visual styles. This class cannot be inherited.
Read more >Solved: Galleries not rendering properly after publishing
Solved: Hello, I am running into an issue where my galleries load just fine in the designer when I click Preview. However, when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just so anyone stumbling across this topic can find a resolution, here is the way I deal with this issue: In a WPF resource (global or in <Window.Resources> add the following:
Then when you use a GroupBox set it style like this:
Hope it helps someone
I got the issue fixed thanks for helping 😃