Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the header background of a GroupBox?

Tags:

wpf

xaml

How can I change the Background of the header of a GroupBox? I'm trying to do that with:

<GroupBox Grid.Row="0">
   <GroupBox.Header>
       <Setter Property="Background" //<- no backgroundproperty

there is no Background property

like image 985
il santino Avatar asked Oct 26 '25 04:10

il santino


1 Answers

You can define a Border in the Header and set the Background of it to your desired color:

<GroupBox >
    <GroupBox.Header>
        <Border Background="Red">
            <Label Content="Hello"></Label>
        </Border>
    </GroupBox.Header>
</GroupBox>
like image 66
Yvonnila Avatar answered Oct 28 '25 05:10

Yvonnila