Skip to main content

Step 1 - Document Manager

  • 2 minutes to read

In this lesson, you will learn how to use the Document Manager component.

  1. Start the Visual Studio IDE and create a new .NET Framework Windows Forms Application. You can use predefined app templates from the DevExpress WinForms App Template Gallery:

    DockingUI - Create Project

  2. Locate the DocumentManager component in the Visual Studio Toolbox and drop it onto your form:

    DockingUI - DocumentManager Toolbox

  3. Right-click your project in Solution Explorer to invoke the context menu, and then select Add DevExpress Item | User Control…. Add two User Controls to the project (XtraUserControl1, XtraUserControl2):

    DockingUI - Add UserControls

    Add UI controls to User Controls and customize their properties as needed.

  4. Build the solution.

    DockingUI - Add UserControls Dialog

  5. Switch to Form1. Select the DocumentManager component and invoke its smart tag menu. Although DocumentManager uses the Tabbed View, you can use the ‘Convert to…’ links to change the view.
  6. In the same context menu, click Run Designer to run the Document Manager’s Designer:

    DockingUI - DocumentManager SmartTag

  7. Switch to Documents and add two documents:

    DockingUI - Documents Designer

  8. For each document, use the ControlTypeName property’s drop-down menu to assign a User Control to the document:

    DockingUI - Document ControlName

    Note

    In v24.1+, you can add User Controls and Forms to documents at design time (in Visual Studio). In previous versions, handle the QueryControl event to assign content to documents:

    void tabbedView1_QueryControl(object sender, DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs e) {
        if (e.Document.ControlName == "UserControl1") e.Control = new UserControl1();
        else e.Control = new UserControl2();
    }
    

The image below shows the result:

DockingUI - Step1 Result

In the next lesson, you will learn how to combine the Document Manager with the Dock Manager in your Windows Forms application.

See Also