Skip to main content
A newer version of this page is available. .

DXTabControl() Constructor

Initializes a new instance of the DXTabControl class.

Namespace: DevExpress.Xpf.Core

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

Declaration

public DXTabControl()

Remarks

Use this constructor to create a new DXTabControl at runtime. After a new tab control has been created, it does not contain any tab items. You should manually create DXTabItem objects and add them to the tab control’s Items collection or bind the tab control to a data source using the ItemsSource property. In the second instance, make sure you have specified the templates used to present headers and content of tab items. To do this, use the DXTabItem.HeaderTemplate, DXTabItem.ContentTemplate and ItemTemplate properties, respectively.

Example

The following example shows how to create a DXTabControl in code.

Imports Microsoft.VisualBasic
Imports System.Windows
Imports System.Windows.Controls
Imports DevExpress.Xpf.Core

Namespace DXTabControl_CreatingManually
    Partial Public Class MainWindow
        Inherits Window
        Public Sub New()
            InitializeComponent()
        End Sub
        Private Sub LayoutRoot_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
            Dim tabControl As New DXTabControl()
            tabControl.Height = 75
            tabControl.Width = 200

            Dim tabItem1 As New DXTabItem()
            tabItem1.Header = "Button"
            tabItem1.Content = New Button() With {.Content = "Button"}
            tabControl.Items.Add(tabItem1)

            Dim tabItem2 As New DXTabItem()
            tabItem2.Header = "Check box"
            tabItem2.Content = New CheckBox() With {.Content = "Check box"}
            tabControl.Items.Add(tabItem2)

            LayoutRoot.Children.Add(tabControl)
        End Sub
    End Class
End Namespace
See Also