RadioButtonコントロールのイベントハンドラ処理
RadioButtonコントロールがクリックされたときは、テキスト表示のC1TabControlコントロールのタブの形状と表示位置を変える処理を組み込みます。タブの形状の指定には、C1TabControlクラスのTabItemShapeプロパティを使用します。それぞれ、C1TabItemShape列挙体のメンバを設定します。
| メンバ名 | 説明 |
| Rectangle | 四角のタブ形状 |
| Rounded | 丸いタブ形状 |
| Sloped | 斜めのタブ形状 |
| Ribbon | S字型タブ |
また、タブの表示位置は、C1TabControlクラスのTabStripPlacementプロパティで設定します。設定値は、C1.WPF名前空間にあるDockクラスのメンバを指定します。
Private Sub radioButton1_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles radioButton1.Checked
c1TabControl1.TabItemShape = C1TabItemShape.Rectangle
End Sub
Private Sub radioButton2_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles radioButton2.Checked
c1TabControl1.TabItemShape = C1TabItemShape.Rounded
End Sub
Private Sub radioButton3_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles radioButton3.Checked
c1TabControl1.TabItemShape = C1TabItemShape.Sloped
End Sub
Private Sub radioButton4_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
c1TabControl1.TabStripPlacement = C1.WPF.Dock.Top
End Sub
Private Sub radioButton5_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
c1TabControl1.TabStripPlacement = C1.WPF.Dock.Bottom
End Sub
Private Sub radioButton6_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
c1TabControl1.TabStripPlacement = C1.WPF.Dock.Right
End Sub
Private Sub radioButton7_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
c1TabControl1.TabStripPlacement = C1.WPF.Dock.Left
End Sub
private void radioButton1_Checked(object sender, RoutedEventArgs e)
{
c1TabControl1.TabItemShape = C1TabItemShape.Rectangle;
}
private void radioButton2_Checked(object sender, RoutedEventArgs e)
{
c1TabControl1.TabItemShape = C1TabItemShape.Rounded;
}
private void radioButton3_Checked(object sender, RoutedEventArgs e)
{
c1TabControl1.TabItemShape = C1TabItemShape.Sloped;
}
private void radioButton4_Checked(object sender, RoutedEventArgs e)
{
c1TabControl1.TabStripPlacement = C1.WPF.Dock.Top;
}
private void radioButton5_Checked(object sender, RoutedEventArgs e)
{
c1TabControl1.TabStripPlacement = C1.WPF.Dock.Bottom;
}
private void radioButton6_Checked(object sender, RoutedEventArgs e)
{
c1TabControl1.TabStripPlacement = C1.WPF.Dock.Right;
}
private void radioButton7_Checked(object sender, RoutedEventArgs e)
{
c1TabControl1.TabStripPlacement = C1.WPF.Dock.Left;
}
まとめ
1つのコントロールで複数のタブページを使用できれば、ページエリアを有効に使うことができるとともに、多くの機能を整理して組み込むことができます。
多機能が求められている昨今のアプリケーションでは、威力を発揮するコントロールではないでしょうか。

