Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DockPanel.DockTo(DockPanel, DockingStyle, Int32) Method

Docks the current panel on the form (user control) to the specified panel at the specified position using the specified style.

Namespace: DevExpress.XtraBars.Docking

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public void DockTo(
    DockPanel panel,
    DockingStyle dock,
    int index
)

#Parameters

Name Type Description
panel DockPanel

A DockPanel object that is the target dock panel.

dock DockingStyle

A DockingStyle enumerator value specifying how the current panel is docked to the target panel.

index Int32

A zero-based integer specifying the position at which to dock the current panel.

#Remarks

If the current panel is docked to a split container or tab container, it’s added as a new child to this container.

If the target panel does not contain children, a split container is created in place of the target panel. The split container will display both the target and current panel.

The dock parameter specifies how the panel is docked - to the target panel’s left, right, bottom or top edge.

The index parameter specifies the position in which the current panel is docked. Set the index parameter to 0 to add the panel as the first one amongst the target container’s children. Set index to 1 to add the panel as the second one, etc. Setting the index parameter to -1appends the panel to the container. To get the position of a panel amongst its sibling panels, use the DockPanel.Index property.

Note

See Also