windowsforms-devexpress-dot-xtrabars-dot-tabform.md
Gets or sets the TabFormControl integrated in the TabForm.
Namespace : DevExpress.XtraBars
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[Browsable(false)]
[DefaultValue(null)]
public TabFormControl TabFormControl { get; set; }
<Browsable(False)>
<DefaultValue(Nothing)>
Public Property TabFormControl As TabFormControl
| Type | Default | Description |
|---|---|---|
| TabFormControl | null |
A TabFormControl integrated with the form.
|
The TabFormControl property accesses the TabFormControl associated with the current TabForm.
A TabFormControl defines the visual and functional structure of a tabbed form. It hosts tab pages and custom buttons.
The following code snippet uses the TabFormControl property to manage tabs in a TabForm. The TabForm and the XtraUserControl are created at design time.
TabFormControl integrated with the form and adds a new TabFormPage to its Pages collection.TabFormContentContainer to the page and displays a custom user control inside the tab.TabFormControl.SelectedPage property to activate the page at runtime.using DevExpress.XtraBars;
using System.Windows.Forms;
namespace DXApplication
{
public partial class Form1 : TabForm
{
TabFormPage page;
TabFormContentContainer container;
public Form1()
{
InitializeComponent();
// Initialize a container for the page content.
container = new TabFormContentContainer()
{
Dock = DockStyle.Fill
};
// Add a user control to the content container.
container.Controls.Add(new XtraUserControl1() { Dock = DockStyle.Fill });
// Create a tab page and associate it with the content container.
page = new TabFormPage()
{
Text = "Address",
ContentContainer = container
};
// Add the page to the TabFormControl.
this.TabFormControl.Pages.Add(page);
// Activate the page when the form loads.
this.TabFormControl.SelectedPage = page;
}
}
}
The following screenshot illustrates the result:
See Also