windowsforms-devexpress-dot-xtrabars-dot-tabformpage-4c24a822.md
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
[Browsable(false)]
[DefaultValue(null)]
public Control ContentContainer { get; set; }
<DefaultValue(Nothing)>
<Browsable(False)>
Public Property ContentContainer As Control
| Type | Default | Description |
|---|---|---|
| Control | null |
A Control object that specifies the control displayed in the current TabFormPage‘s client area.
|
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.
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);
}
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