Appends a tab containing the current panel to the target tab container. The target tab container is created if necessary.
A DockPanel object representing the target tab container or target tab container's tab, or a panel that points to the location at which to create the target tab container.
If the target panel does not represent a tab container or a tab container's tab, this method creates a new target tab container and positions it where the target panel is. Otherwise, the current panel is added as a tab page to the existing tab container.
The new tab containing the current panel is added as the last tab in the target tab container. To add a tab containing the current panel in a specific position, use the DockPanel.DockAsTab overload which takes the index parameter. Please refer to this topic, for more information on the DockAsTab method's behavior.
In the following code two floating panels are created and then combined to form a single tab container. A tab container is created via the DockPanel.DockAsTab method and this method can be used to create new tabs in the created tab container later on.
Which tab in the tab container contains which panel is specified by this method's index parameter. In this example, the tab page containing the second panel (dp2) will be added to the first tab because the index parameter is set to 0.
The result is shown below:
using DevExpress.XtraBars.Docking; // .. // Create two floating panels. DockPanel dp1 = dockManager1.AddPanel(DockingStyle.Float); dp1.Text = "Panel 1"; DockPanel dp2 = dockManager1.AddPanel(DockingStyle.Float); dp2.Text = "Panel 2"; // Create a tab container consisting of these panels. // Panel dp2 will be displayed within the first tab. dp2.DockAsTab(dp1, 0);