Posted 9 June 2023, 5:15 am EST
Hello, I’m trying to modify the color of a selected TabItem upon selection. Could you guide me through this process? I appreciate your help in advance.
Forums Home / ComponentOne / WPF Edition
Posted by: ronen.hong on 9 June 2023, 5:15 am EST
Posted 9 June 2023, 5:15 am EST
Hello, I’m trying to modify the color of a selected TabItem upon selection. Could you guide me through this process? I appreciate your help in advance.
Posted 12 June 2023, 12:20 am EST
Hi kyungsoo,
You can set the background color of the selected header tab by setting the style defined to C1TabControl’s SelectedTabHeaderStyle as shown in the following code:
//defining the style
<Style x:Key="selectedTabHeaderStyle" TargetType="c1:C1TabItemPresenter">
<Setter Property="Background" Value="Red"/>
</Style>
//using the style
<c1:C1TabControl Name="tabControl" SelectedIndex="0" SelectedTabHeaderStyle="{StaticResource selectedTabHeaderStyle}">
Kindly refer to the attached sample for full implementation. (See SelectedTabItemColor.zip)
Thanks & Regards,
Aastha