We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set the header Background color on a specific MDI child in DocumentContainer ?

Platform: WPF |
Control: DocumentContainer

In DocumentContainer, set the header’s background color on a specific MDIchild using DocumentMDIHeaderStyle property.



<Style x:Key="headerstyle" TargetType="syncfusion:DocumentHeader">

      <Setter Property="Header" Value="syncfusion:DocumentHeader.Header"/>

        <Setter Property="Background">


                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">

                        <GradientStop Color="#FFD9EDFF" Offset="0"/>

                        <GradientStop Color="#FFC0DEFF" Offset="0.445"/>

                        <GradientStop Color="#FFAFD1F8" Offset="0.53"/>






<syncfusion:DocumentContainer x:Name="Doccontainer" Mode="MDI">

            <ContentControl x:Name="child1" syncfusion:DocumentContainer.Header="Document1" syncfusion:DocumentContainer.DocumentMDIHeaderStyle="{StaticResource headerstyle}">


            <ContentControl x:Name="child2" syncfusion:DocumentContainer.Header="Document2">

                <TextBlock Text="This is a document2"/>


            <ContentControl x:Name="child3" syncfusion:DocumentContainer.Header="Document3"/>



Style style = this.FindResource("headerstyle") as Style;

child1.SetValue(DocumentContainer.DocumentMDIHeaderStyleProperty, style);

The following screenshot displays the setting of the header background color on a specific MDIchild,

Figure 1: Output

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile