Back to Devexpress

TabFormPage.ContentContainer Property

windowsforms-devexpress-dot-xtrabars-dot-tabformpage-4c24a822.md

latest3.1 KB
Original Source

TabFormPage.ContentContainer Property

Gets or sets the control displayed in the current TabFormPage‘s client area.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
[DefaultValue(null)]
public Control ContentContainer { get; set; }
vb
<DefaultValue(Nothing)>
<Browsable(False)>
Public Property ContentContainer As Control

Property Value

TypeDefaultDescription
Controlnull

A Control object that specifies the control displayed in the current TabFormPage‘s client area.

|

Remarks

The ContentContainer property allows you to specify the control displayed in the current TabFormPage‘s client area when it is selected. For instance, you can specify this property handling the TabFormControlBase.PageCreated event. The code snippet below shows how to display a web browser in a new page.

csharp
private void tabFormControl1_PageCreated(object sender, DevExpress.XtraBars.PageCreatedEventArgs e) {
    WebBrowser wb = new WebBrowser();
    wb.Dock = DockStyle.Fill;
    TextBox tb = new TextBox();
    tb.Dock = DockStyle.Top;
    tb.KeyDown += (kds, kde) => {
        if (kde.KeyData == Keys.Enter)
            wb.Navigate(tb.Text);
    };
    e.Page.ContentContainer.Controls.Add(wb);
    e.Page.ContentContainer.Controls.Add(tb);
}
vb
Private Sub TabFormControl1_PageCreated(sender As Object, e As DevExpress.XtraBars.PageCreatedEventArgs) Handles TabFormControl1.PageCreated
    Dim wb As New WebBrowser()
    Dim tb As New TextBox()
    wb.Dock = DockStyle.Fill
    tb.Dock = DockStyle.Top
    AddHandler tb.KeyDown, Function(kds As Object, kde As KeyEventArgs)
                               If kde.KeyData = Keys.Enter Then
                                   wb.Navigate(tb.Text)
                               End If
                           End Function
    e.Page.ContentContainer.Controls.Add(wb)
    e.Page.ContentContainer.Controls.Add(tb)

End Sub

See Also

SelectedContainer

SelectedPage

TabFormPage Class

TabFormPage Members

DevExpress.XtraBars Namespace