TabControl

Allows you to display multiple tabs of the same controls.


A control that can contain multiple items that share the same space


<TabControl Name="TabControl1" 
       Height="Auto"
       Width="Auto"
       VerticalAlignment="Stretch"
       HorizontalAlignment="Stretch">
       Margin="10,10,10,31"
       Background="Bisque">

   <TabItem Header="TabItem">
      <Grid Background="#FFE5E5E5"
             Margin="10,10,10,10"/>

   <TabItem Header="TabItem">

</TabControl>

TabItem Style

Defining a style for your TabItem controls


<Window.Resouces> 
    <Style TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                 <ControlTemplate TargetType="{x:Type TabItem}">
                      <Grid>
                           <Border Name="Border"
                                Background="LightBlue"
                                BorderBrush="Black"
                                BorderThickness="1,1,1,1"
                                CornerRadius="6,6,0,0">
                           <ContentPresenter x:Name="ContentSite"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                ContentSource="Header"
                                Margin="12,2,12,2" /gt
                        </Border>
                     </Grid>
                  </ControlTemplate>

    </Style>
</Window.Resouces>


Highlight Active Tab




© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext