Skip to content

Instantly share code, notes, and snippets.

@pinzolo
Created June 18, 2012 07:06
Show Gist options
  • Save pinzolo/2947230 to your computer and use it in GitHub Desktop.
Save pinzolo/2947230 to your computer and use it in GitHub Desktop.
タブを非表示にしたタブコントロール
<Window x:Class="MktSys.Gui.NoHeaderTabItemWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="タブのない TabControl" Height="525" Width="300">
<Window.Resources>
<!--
フォーカスがあたらないように IsTabStop を False
LayoutTransFormで無理やりタブを非表示にする
-->
<Style x:Key="noHeaderTabItemStyle" TargetType="{x:Type TabItem}">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="LayoutTransform">
<Setter.Value>
<TransformGroup>
<ScaleTransform ScaleY="0"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<TabControl Name="tabControl">
<TabItem Header="変数" Name="editVriableTabItem" Style="noHeaderTabItemStyle">
<Grid>
</Grid>
</TabItem>
</TabControl>
</Grid>
</Window>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment