Skip to main content

BaseView.AddDocument(String, String) Method

Adds an empty Document with specified BaseDocument.Caption and BaseDocument.ControlName properties to the current View.

Namespace: DevExpress.XtraBars.Docking2010.Views

Assembly: DevExpress.XtraBars.v24.2.dll

Declaration

public BaseDocument AddDocument(
    string caption,
    string controlName
)

Parameters

Name Type Description
caption String

A String value that is the newly created Document’s BaseDocument.Caption.

controlName String

A String value that is the newly created Document’s BaseDocument.ControlName property value.

Returns

Type Description
BaseDocument

A BaseDocument object created.

Remarks

The AddDocument method adds a new Document to the View. This Document has no content yet, but it refers to a Control (for instance, a UserControl) via the BaseDocument.ControlName property. On application start-up, before the form is shown, call the BaseView.AddDocument overload method that takes a control as a parameter and pass a new instance of this UserControl to this method. This won’t create any new documents. Instead, a Document created via the AddDocument method will receive a UserControl specified via the BaseDocument.ControlName property as a content.

//Creates an empty Document 'Doc 1' that refers to the UserControl1
documentManager1.View.AddDocument("Doc 1", "UserControl1");
//Sets the UserControl1 as a content for the 'Doc 1'
documentManager1.View.AddDocument(new UserControls.UserControl1());
See Also