如何从TabItem中删除选项卡?

时间:2022-03-22 22:37:25

I am trying to remove the button on the Tab menu, but there does not seem to be anything in the properties that will allow this,

我试图删除选项卡菜单上的按钮,但似乎没有任何属性允许这样做,

如何从TabItem中删除选项卡?

I don't have much thus far as I have been trying remove the button on the tab first, this below just stops you from clicking the tab and anything on it, I want to make it transparent or remove it completely if possible.

到目前为止,我一直没有太多尝试删除选项卡上的按钮,下面只是阻止您单击选项卡及其上的任何内容,我想让它透明或尽可能完全删除它。

<Setter Property="IsEnabled" Value="False"/>

This below makes the whole TabControl transparent, which defeats the purpose of the container,

这使得整个TabControl透明,这违背了容器的目的,

<Setter Property="Visibility" Value="Hidden"/>

This is the XAML I have thus far,

这是我到目前为止的XAML,

<Style TargetType="{x:Type TabControl}">
            <Setter Property="Background" Value="Black" />
            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="IsEnabled" Value="False"/>
</Style>

Is there a way to do this? Or am I stuck with these tab buttons?

有没有办法做到这一点?或者我坚持使用这些标签按钮?

1 个解决方案

#1


0  

It is not the TabControl, it is the TabItem control that needed to be worked on.

它不是TabControl,它是需要处理的TabItem控件。

This code hides the Tab Buttons and all borders,

此代码隐藏了Tab按钮和所有边框,

<Style TargetType="{x:Type TabItem}">
        <Setter Property="Background" Value="Black" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Visibility" Value="Hidden"/>
</Style>

#1


0  

It is not the TabControl, it is the TabItem control that needed to be worked on.

它不是TabControl,它是需要处理的TabItem控件。

This code hides the Tab Buttons and all borders,

此代码隐藏了Tab按钮和所有边框,

<Style TargetType="{x:Type TabItem}">
        <Setter Property="Background" Value="Black" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Visibility" Value="Hidden"/>
</Style>