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>
精彩评论