Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>if you make the tab control as a custom control and inherit the functionality from tab control and then add close button and handle its events then it can work</p> <pre><code> &lt;UserControl x:Class="CloseableHeader" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="23" d:DesignWidth="81" Margin="0"&gt; &lt;Grid&gt; &lt;Button Content="X" Height="19" HorizontalAlignment="Right" Margin="0,3,4,0" Name="button_close" VerticalAlignment="Top" Width="20" FontFamily="Courier" FontWeight="Bold" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" FontStretch="Normal" Visibility="Visible" FontSize="14" Padding="0" ToolTip="Close"/&gt; &lt;Label Content="TabItem" Height="23" HorizontalAlignment="Left" Margin="4,1,0,0" Name="label_TabTitle" VerticalAlignment="Top" FontFamily="Courier" FontSize="12" /&gt; &lt;/Grid&gt; </code></pre> <p></p> <pre><code> class ClosableTab : TabItem { // Constructor public ClosableTab() { // Create an instance of the usercontrol closableTabHeader = new CloseableHeader(); // Assign the usercontrol to the tab header this.Header = closableTabHeader; } } </code></pre> <p>see in this article for details <a href="http://www.codeproject.com/Articles/84213/How-to-add-a-Close-button-to-a-WPF-TabItem" rel="noreferrer">http://www.codeproject.com/Articles/84213/How-to-add-a-Close-button-to-a-WPF-TabItem</a> this might be helpful</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload