Back to Devexpress

QueryControlEventArgs.Control Property

windowsforms-devexpress-dot-xtrabars-dot-docking2010-dot-views-dot-querycontroleventargs.md

latest5.2 KB
Original Source

QueryControlEventArgs.Control Property

Gets or sets the content of the document that raised the current BaseView.QueryControl event.

Namespace : DevExpress.XtraBars.Docking2010.Views

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public Control Control { get; set; }
vb
Public Property Control As Control

Property Value

TypeDescription
Control

A Control that is the current document’s content.

|

Remarks

Each time a document with no content is to be shown, the BaseView.QueryControl event occurs. Use the Control property to pass the required content to this document.

See the Deferred Load topic to learn more.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Control property.

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.

winforms-create-custom-document-manager/CS/CustomDocument/Main.cs#L24

csharp
if (e.Document == xtraUserControl3Document)
    e.Control = new CustomDocumentApplication.XtraUserControl3();
if (e.Document == xtraUserControl2Document)

reporting-winforms-salary-reports/CS/SalaryReports/MainForm.cs#L16

csharp
case 0:
    e.Control = new DocumentViewerUserControl() { Report = new ManagementReport() };
    break;

winforms-document-manager-web-browser-ui/CS/Form1.cs#L34

csharp
docs.Add(e.Document);
    e.Control = wb;
}

winforms-workspacemanager-saving-load-app-layout/CS/T190543/Form1.cs#L54

csharp
private void tabbedView1_QueryControl(object sender, DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs e) {
    e.Control = new Control();
}

winforms-create-custom-document-manager/VB/CustomDocument/Main.vb#L26

vb
If e.Document Is xtraUserControl3Document Then
    e.Control = New CustomDocumentApplication.XtraUserControl3()
End If

reporting-winforms-salary-reports/VB/SalaryReports/MainForm.vb#L14

vb
Case 0
    e.Control = New DocumentViewerUserControl() With {.Report = New ManagementReport()}
Case 1

winforms-document-manager-web-browser-ui/VB/Form1.vb#L27

vb
docs.Add(e.Document)
    e.Control = wb
End Sub

winforms-workspacemanager-saving-load-app-layout/VB/T190543/Form1.vb#L51

vb
Private Sub tabbedView1_QueryControl(ByVal sender As Object, ByVal e As DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs)
    e.Control = New Control()
End Sub

See Also

QueryControl

Deferred Load

QueryControlEventArgs Class

QueryControlEventArgs Members

DevExpress.XtraBars.Docking2010.Views Namespace