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.v18.2.dll
Declaration
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());
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AddDocument(String, String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.