2011-04-22 28 views
7

¿Cómo cambiar la fuente en el encabezado de TabItem sin cambiar la fuente del contenido? Cuando configuré la propiedad FontSize en TabItem, también cambié FontSize en TextBlock s.¿Cómo cambiar la fuente del encabezado de TabItem sin cambiar la fuente del contenido?

<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> 

Respuesta

16

Puede hacer como esto -

 <TabControl> 
      <TabItem> 
       <TabItem.Header> 
        <TextBlock Text="Tab1" FontSize="23" /> 
       </TabItem.Header> 
       <TextBlock Text="Content" /> 
      </TabItem> 
     </TabControl> 
Cuestiones relacionadas