Category / Section
How to set Selected Splitterpage header Background color in TabSplitter?
1 min read
Selected SplitterPage header Background color can be changed by SelectedBackground property of TabSplitter.
The same has been explained in the following code snippet:
XAML:
//Code Explains How to set selected header Background color in splitterpage <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="TablSplitet_ActivetabBack.MainWindow" Title="MainWindow" Height="350" Width="525"> <Grid> <syncfusion:TabSplitter x:Name="TabSplitter1" SelectedBackground="DarkGreen" MouseOverBackground="Magenta" Foreground="BlueViolet"> <syncfusion:TabSplitterItem Header="tab1" Orientation="Horizontal"> <syncfusion:TabSplitterItem.BottomPanelItems> <syncfusion:SplitterPage Name="splitterPage1" Header="XAML"> </syncfusion:SplitterPage> <syncfusion:SplitterPage Name="splitterPage2" Header="XAML1"> </syncfusion:SplitterPage> </syncfusion:TabSplitterItem.BottomPanelItems> <syncfusion:TabSplitterItem.TopPanelItems> <syncfusion:SplitterPage Name="splitterPage3" Header="Top1"> </syncfusion:SplitterPage> <syncfusion:SplitterPage Name="splitterPage4" Header="Top2"> </syncfusion:SplitterPage> </syncfusion:TabSplitterItem.TopPanelItems> </syncfusion:TabSplitterItem> <syncfusion:TabSplitterItem Header="tab2"> </syncfusion:TabSplitterItem> </syncfusion:TabSplitter> </Grid> </Window>
C#:
//Code Explains How to set selected header Background color in splitterpage namespace TablSplitet_ActivetabBack { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); TabSplitter1.SelectedBackground = Brushes.Green; } } }
Output: