Skip to main content

TabbedView Class

Presents MDI child windows as a tabbed UI.

Namespace: DevExpress.XtraBars.Docking2010.Views.Tabbed

Assembly: DevExpress.XtraBars.v24.2.dll

Declaration

public class TabbedView :
    BaseView,
    IThumbnailViewClient,
    IFreeLayoutView,
    ISupportBatchUpdate,
    ISupportAdornerUIManager,
    IWin32Window,
    IUpdateAdornerUI

Remarks

MDI child windows can be presented by a DocumentManager either as a native MDI or tabbed UI. To use the tabbed UI, create a TabbedView object and assign it to the DocumentManager.View property. To enable a native MDI, create a NativeMdiView object and assign it to the DocumentManager.View property.

Documents in a TabbedView are displayed as tabs. You can split the View’s area vertically or horizontally into document groups. In code, you can create a new group via the ITabbedViewController.CreateNewDocumentGroup method accessible via the View’s Controller object. An end-user can split the area via a document’s context menu or drag-and-drop.

When you do not create extra groups, there is one default group that displays all documents. When document groups are created, they are added to the TabbedView.DocumentGroups collection.

The number of documents displayed simultaneously in a group can be limited via the IDocumentGroupProperties.MaxDocuments and IDocumentGroupDefaultProperties.MaxDocuments properties.

Example

This example enables a tabbed UI for a DocumentManager. The example creates two document groups. MDI child windows are presented as tab pages.

Tabbed UI - WinForms Document Manager, DevExpress

using DevExpress.XtraEditors;
using DevExpress.XtraBars.Docking2010;
using DevExpress.XtraBars.Docking2010.Views.Tabbed;
using System.Windows.Forms;

namespace DXApplication {
    public partial class Form1 : XtraForm {
        DocumentManager docManager;
        public Form1() {
            InitializeComponent();

            InitDocumentManager();
            AddChildForms(5);
            AddDocumentGroup(Orientation.Vertical, 2);
        }
        void InitDocumentManager() {
            docManager = new DocumentManager(components) {
                MdiParent = this,
                View = new TabbedView()
            };
        }
        void AddChildForms(int count) {
            for (int i = 0; i < count; i++)
                AddChildForm(i);
        }
        void AddDocumentGroup(Orientation groupOrientation, int documentIndex) {
            (docManager.View as TabbedView).Controller.CreateNewDocumentGroup(docManager.View.Documents[documentIndex] as Document, groupOrientation);
        }
        void AddChildForm(int number) {
            XtraForm childForm = new XtraForm() {
                Text = string.Format("Child Form ({0})", number),
                MdiParent = this
            };
            SimpleButton btn = new SimpleButton() {
                Text = string.Format("Button"),
                Parent = childForm
            };
            childForm.Show();
        }
    }
}
See Also