Version

Add a Tab to xamTabControl

Just like the tab control found in Microsoft® Windows® Presentation Foundation, you have to add tabs to xamTabControl™ in order to display tabbed content. Unlike the Windows Presentation Foundation TabControl, xamTabControl works with TabItem objects as well as the enhanced TabItemEx objects. If you add TabItemEx objects to xamTabControl’s Items collection, you can enable tab closing. If you add regular TabItem objects, you will not have this functionality.

The following example code demonstrates how to add a tab to xamTabControl.

xamTabControl Add a Tab to xamTabControl 01.png

In XAML:

<igWindows:XamTabControl Name="xamTabControl1">
    <igWindows:TabItemEx Header="Tab 1">
        <!--TODO: Add a panel with content here-->
    </igWindows:TabItemEx>
</igWindows:XamTabControl>

In Visual Basic:

Imports Infragistics.Windows.Controls
...
Dim tab1 As New TabItemEx() With {.Header = "Tab 1"}
Me.xamTabControl1.Items.Add(tab1)

In C#:

using Infragistics.Windows.Controls;
...
TabItemEx tab1 = new TabItemEx(){ Header = "Tab 1" };
this.xamTabControl1.Items.Add(tab1);