Back to Devexpress

DXTabControl Class

wpf-devexpress-dot-xpf-dot-core-821ca241.md

latest8.1 KB
Original Source

DXTabControl Class

Represents the DXTabControl.

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
[DXLicenseWpfEditors]
public class DXTabControl :
    HeaderedSelectorBase<DXTabControl, DXTabItem>,
    ICloneable,
    IThemedWindowSupport,
    IMultipleElementRegistratorSupport,
    IBarNameScopeSupport,
    IInputElement
vb
<DXLicenseWpfEditors>
Public Class DXTabControl
    Inherits HeaderedSelectorBase(Of DXTabControl, DXTabItem)
    Implements ICloneable,
               IThemedWindowSupport,
               IMultipleElementRegistratorSupport,
               IBarNameScopeSupport,
               IInputElement

The following members return DXTabControl objects:

Remarks

The DXTabControl provides you the tab-based navigation functionality for your applications.

Create a DXTabControl

Drag the DXTabControl from the Visual Studio Toolbox and drop it onto the form.

xaml
<dx:DXTabControl>
    <dx:DXTabItem Header="Tab">
        <Grid Background="Transparent"/>
    </dx:DXTabItem>
</dx:DXTabControl>

Populate with Items

You can add DXTabItems in the DXTabControl in any of the following ways:

  • Click the Add Tab item in the DXTabControl’s Smart Tag.

  • Create DXTabItem objects and add them to the DXTabControl.Items collection.

  • Add arbitrary objects (data items) to the DXTabControl.Items collection and specify the DXTabControl.ItemTemplate and DXTabControl.ItemHeaderTemplate templates. These templates define how to present tab headers and pages, respectively. In this instance, DXTabItem objects will be generated from data items automatically.

  • Bind the tab control to a data source. To do this, assign a data source to the DXTabControl.ItemsSource property. In this case, the control retrieves data items from the data source and add them to the DXTabControl.Items collection. Similar to the previous case, you should specify the DXTabControl.ItemTemplate and DXTabControl.ItemHeaderTemplate templates to define the tab headers and pages visual presentation.

Integrate to a ThemedWindow

Set the WindowKind to Tabbed to integrate the DXTabControl into the ThemedWindow.

Hide Tabs

The DXTabControl allows you to hide individual tab items. A hidden tab item is not disposed and can be shown later. To hide a tab, you should display the Tab’s Hide button with the DXTabItem.AllowHide property and use the HideTabItem method. Refer to the Showing and Hiding Tab Items topic for more information on how to hide and show tabs.

Control Appearance

The view objects define the DXTabControl ‘s layout, style and behavior settings. Views are represented by the TabControlViewBase descendant classes. Create a view object and assign it to the DXTabControl.View property to apply a view to the DXTabControl.

Refer to the Appearance Customization topic for more information.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DXTabControl class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-spreadsheet-chart-api/CS/SpreadsheetWPFChartAPISamples/MainWindow.xaml#L29

xml
<dx:DXTabControl x:Name="tabControl" Grid.Row="1" Grid.Column="0" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="CS" Width="250">

wpf-spreadsheet-pivot-table-api-examples/CS/SpreadsheetWPFPivotTableExamples/MainWindow.xaml#L29

xml
<dx:DXTabControl x:Name="tabControl" Grid.Row="1" Grid.Column="0" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="CS" Width="250">

wpf-richedit-document-api/CS/DXRichEditControlAPISample/MainWindow.xaml#L28

xml
<dx:DXTabControl x:Name="tabControl" Grid.Row="1" Grid.Column="0" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="CS" Width="250">

dxrichedit-for-wpf-how-to-implement-progress-indicator/CS/MainWindow.xaml#L17

xml
<Button Name="btnMailMerge" Content="Mail Merge" Width="200" HorizontalAlignment="Left" Margin="5" Click="btnMailMerge_Click" />
<dx:DXTabControl Name="tabControl" Grid.Row="1" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="Template">

wpf-richedit-use-docvariable-fields/CS/MainWindow.xaml#L21

xml
<dx:DXTabControl Name="tabControl" Grid.Row="1" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="Template">

Inheritance

Show 11 items

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control ItemsControl DevExpress.Xpf.Core.Native.SelectorBase<DXTabControl, DXTabItem> DevExpress.Xpf.Core.Native.HeaderedSelectorBase<DXTabControl, DXTabItem> DXTabControl

See Also

DXTabControl Members

DevExpress.Xpf.Core Namespace