TabControlを使う WPFTabControlを使う WPFTabと言えば、狭いウィンドウ内に、多くの入力を必要とするフォームを作る際には、必須のコントロールでした。 ![]() ![]() 「呼び出し履歴」の機能も紹介。このルーチンがどこから呼び出されている? というスパゲティー状態になったら力を発揮する。 実行して、下図のように表示すればよいらしい。 ![]() あとは、赤囲いの中の行を適当にクリックするとよい。
<Window x:Class="TabControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="TabControl" Height="297" Width="519" WindowStartupLocation="CenterScreen">
<Grid>
<StackPanel>
<TabControl Height="220" Width="220" HorizontalAlignment="Center" Name="TabControl1" VerticalAlignment="Top" Background="#82D2E05E" TabStripPlacement="Left">
<TabItem Header="TabItem1" Name="TabItem1" >
<Grid>
<Label Content="タブ1" Name="lbl1"/>
</Grid>
</TabItem>
<TabItem Header="TabItem2" Name="TabItem2" IsSelected="True">
<Grid>
<Label Content="タブ2" Name="lbl2"/>
</Grid>
</TabItem>
<TabItem Header="TabItem3" Name="TabItem3">
<Grid>
<Label Content="タブ3" Name="lbl3"/>
</Grid>
</TabItem>
</TabControl>
<Button Content="Button" Height="23" Name="Button1" Width="75" />
</StackPanel>
</Grid>
</Window>
|