In the WPF element of GroupBox I need to remove the empty space where the label should be.

If you set the property to an empty string

 Header = "" 

it still remains an empty space. How to remove it?

Or maybe there is another control for combining elements?

    1 answer 1

    Place two GroupBox in the Grid by flipping one of them horizontally.

     <Grid> <GroupBox Name="mainGroupBox"> </GroupBox> <GroupBox Focusable="False" Panel.ZIndex="-1" Width="{Binding ActualWidth, ElementName=mainGroupBox}" Height="{Binding ActualHeight, ElementName=mainGroupBox}" IsEnabled="{Binding IsEnabled, ElementName=mainGroupBox}" RenderTransformOrigin="0.5,0.5"> <GroupBox.RenderTransform> <ScaleTransform ScaleX="-1"/> </GroupBox.RenderTransform> </GroupBox> </Grid> 

    The idea is taken with enSO .

    Or maybe there is another control for combining elements?

    Use Border :

     <Border BorderBrush="Gray" BorderThickness="1" CornerRadius="5" Padding="2" Margin="2"> <TextBlock Text="text"/> </Border>