windowsforms-devexpress-dot-xtralayout-4a3311da.md
The group that features a tabbed UI.
Namespace : DevExpress.XtraLayout
Assembly : DevExpress.XtraLayout.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public class TabbedControlGroup :
TabbedGroup
Public Class TabbedControlGroup
Inherits TabbedGroup
The following members return TabbedControlGroup objects:
A tabbed group is visually represented by tabbed pages, each of which displays a regular group (a LayoutControlGroup object). Thus, a tabbed group is a container of LayoutControlGroup objects. To access the tabbed group’s child groups, use the TabbedControlGroup.TabPages property. To add tabs to the tabbed group, use the TabbedGroup.AddTabPage method.
The text displayed within a tabbed page header is specified by the BaseLayoutItem.Text property of the corresponding LayoutControlGroup group.
The following image shows a form which contains a layout control. The root group displays two regular layout items (Job Title and Contact Name), regular group (Personal Info) and tabbed group. The tabbed group contains two tabs which display two groups (Photo and Notes):
A tabbed group can be created as follows:
The following example shows how to create a tabbed group that contains two pages. The first page will display a group with a layout item that contains a PictureEdit editor.
A tabbed group is created using the LayoutControlGroup.AddTabbedGroup method of the root group. Tabs are added via the TabbedGroup.AddTabPage method.
The following image shows the result:
using DevExpress.XtraLayout;
LayoutControl lc = new LayoutControl();
lc.Dock = System.Windows.Forms.DockStyle.Fill;
this.Controls.Add(lc);
// Lock the layout control to prevent excessive updates.
lc.BeginUpdate();
try {
// Create a tabbed group within the root group.
TabbedControlGroup tabbedGroup = lc.Root.AddTabbedGroup();
tabbedGroup.Name = "TabbedGroup";
// Add the Photo group as a tab.
LayoutControlGroup groupPhoto = tabbedGroup.AddTabPage() as LayoutControlGroup;
groupPhoto.Name = "lgPhoto";
groupPhoto.Text = "Photo";
// Add a new layout item to the group to display an image.
LayoutControlItem liPhoto = groupPhoto.AddItem();
liPhoto.Name = "liPhoto";
liPhoto.Control = new DevExpress.XtraEditors.PictureEdit() { Name = "pePhoto" };
// Hide the item's text region.
liPhoto.TextVisible = false;
// Add the Notes group as a tab.
LayoutControlGroup groupNotes = tabbedGroup.AddTabPage() as LayoutControlGroup;
groupNotes.Name = "lgNotes";
groupNotes.Text = "Notes";
// Add a new layout item to the group to display a memo editor.
LayoutControlItem liNotes = groupNotes.AddItem();
liNotes.Name = "liNotes";
liNotes.Control = new DevExpress.XtraEditors.MemoEdit() { Name = "meNotes" }; ;
// Hide the item's text region.
liNotes.TextVisible = false;
// Make the first tab page active.
tabbedGroup.SelectedTabPage = groupPhoto;
}
finally {
// Unlock and update the layout control.
lc.EndUpdate();
}
Imports DevExpress.XtraLayout
Dim lc As New LayoutControl()
lc.Dock = System.Windows.Forms.DockStyle.Fill
Me.Controls.Add(lc)
' Lock the layout control to prevent excessive updates.
lc.BeginUpdate()
Try
' Create a tabbed group within the root group.
Dim tabbedGroup As TabbedControlGroup = lc.Root.AddTabbedGroup()
tabbedGroup.Name = "TabbedGroup"
' Add the Photo group as a tab.
Dim groupPhoto As LayoutControlGroup = TryCast(tabbedGroup.AddTabPage(), LayoutControlGroup)
groupPhoto.Name = "lgPhoto"
groupPhoto.Text = "Photo"
' Add a new layout item to the group to display an image.
Dim liPhoto As LayoutControlItem = groupPhoto.AddItem()
liPhoto.Name = "liPhoto"
liPhoto.Control = New DevExpress.XtraEditors.PictureEdit() With { _
Key .Name = "pePhoto" _
}
' Hide the item's text region.
liPhoto.TextVisible = False
' Add the Notes group as a tab.
Dim groupNotes As LayoutControlGroup = TryCast(tabbedGroup.AddTabPage(), LayoutControlGroup)
groupNotes.Name = "lgNotes"
groupNotes.Text = "Notes"
' Add a new layout item to the group to display a memo editor.
Dim liNotes As LayoutControlItem = groupNotes.AddItem()
liNotes.Name = "liNotes"
liNotes.Control = New DevExpress.XtraEditors.MemoEdit() With { _
Key .Name = "meNotes" _
}
' Hide the item's text region.
liNotes.TextVisible = False
' Make the first tab page active.
tabbedGroup.SelectedTabPage = groupPhoto
Finally
' Unlock and update the layout control.
lc.EndUpdate()
End Try
Object MarshalByRefObject Component DevExpress.XtraLayout.SupportVisitor BaseLayoutItem LayoutItemContainer TabbedGroup TabbedControlGroup
See Also