选项卡显示:删除底部边框线

时间:2014-03-25 10:40:57

标签: asp.net wpf tabcontrol tabitem

我有一个WPF应用程序,我需要从选中的选项卡中删除底部边框线,以便选定的选项卡无缝地跟随到页面中。 我想删除图像中的红色标记(底部边框线)而不删除选项卡面板/子选项卡面板。 enter image description here

我已经将HeaderPanel的Margin属性设置为 余量= “0,0,4,的 -1 ” 但它没有解决我的问题,而且约束是我的Tab / Sub选项卡面板不能透明/白色Desired Output

请帮忙。

 <Style x:Key="TabControlsample" TargetType="{x:Type TabControl}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="TabControl">
                <Grid ClipToBounds="True" SnapsToDevicePixels="True" KeyboardNavigation.TabNavigation="Local">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="0"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <ScrollViewer x:Name="tabScroller" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" Style="{StaticResource TabScrollView}">
                        <TabPanel x:Name="HeaderPanel" 
                         Margin="2,2,2,0" IsItemsHost="True" 
                        Panel.ZIndex="1" Grid.Column="0" Grid.Row="0" KeyboardNavigation.TabIndex="1"/>
                    </ScrollViewer>
                    <Border x:Name="ContentPanel" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="0" Grid.Row="1" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
                        <ContentPresenter x:Name="PART_SelectedContentHost" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding SelectedContent}" ContentSource="SelectedContent" ContentStringFormat="{TemplateBinding SelectedContentStringFormat}" ContentTemplate="{TemplateBinding SelectedContentTemplate}"/>
                    </Border>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

0 个答案:

没有答案