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.DockAsMdiDocument() Method

Docks the panel to a DocumentManager located in the same form as the current DockManager.

Namespace: DevExpress.XtraBars.Docking

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public bool DockAsMdiDocument()

#Returns

Type Description
Boolean

true if the operation is a success; otherwise, false.

#Remarks

The DockAsMdiDocument method is equivalent to the IBaseViewController.Dock method. The method is not supported when docking a DockPanel to NativeMdiView objects.

When a panel is docked to a DocumentManager, it becomes a document belonging to this DocumentManager. To work with panels transformed into documents, use the methods provided by the TabbedView.Controller object. The document that corresponds to a dock panel can be accessed with the DocumentManager.GetDocument method.

This example docks and undocks the MDI dockPanel1:

void simpleButton1_Click(object sender, EventArgs e) {
    if (documentManager1.GetDocument(dockPanel1) != null) {
        tabbedView1.Controller.Float(dockPanel1);
        simpleButton1.Text = "Dock as MDI";
    }
    else {
        dockPanel1.DockAsMdiDocument(true);
        simpleButton1.Text = "Undock/Float";
    }
}
See Also