How to change font in TabItem's header without changing content's font? When I set FontSize
property in TabItem
it also changing FontSize on TextBlock
s.
<Window x:Class="WpfApplication4.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="350" Width="525">
<TabControl>
<TabItem Header="item1">
<TextBlock Text="test" Margin="20" />
</TabItem>
<TabItem Header="item2" FontSize="20">
<TextBlock Text="test" Margin="20" />
</TabItem>
</TabControl>
</Window>
You can do like this -
<TabControl>
<TabItem>
<TabItem.Header>
<TextBlock Text="Tab1" FontSize="23" />
</TabItem.Header>
<TextBlock Text="Content" />
</TabItem>
</TabControl>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With