- <TabControl Height="100" Name="tabControl1" Width="{Binding ElementName=ParentPanel, Path=Width}" >
- <TabItem Name="tabItem1">
- <TabItem.Style>
- <Style TargetType="{x:Type TabItem}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type TabItem}">
- <Image Name="img2Off" Width="84" Height="70" Source="images/admin_curriculum_on.gif" Margin="0,0,0,0" ></Image>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter TargetName="img2Off" Property="Source" Value="images/admin_curriculum_off.gif"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </TabItem.Style>
- <TextBlock>aaaaaaaaaaa</TextBlock>
- </TabItem>
- </TabControl>
代码转自:http://blog.csdn.net/w59879213/article/details/6264297 感谢前辈的分享。
|