Skip to main content
Bar

TabFormControlBase.PageCreated Event

Fires when an end-user creates a new page using the ‘+’ button, or when a new page is created in code using the TabFormControlBase.AddNewPage method.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.2.dll

Declaration

public event PageCreatedEventHandler PageCreated

Event Data

The PageCreated event's data class is DevExpress.XtraBars.PageCreatedEventArgs.

Remarks

The PageCreated event fires when a new TabFormPage is created with a click on the built-in ‘+’ button, or in code using the TabFormControlBase.AddNewPage method. The PageCreatedEventArgs.Page property provides access to the TabFormPage being created, and allows you to customize the page (specify the tab header, add controls to the container (see TabFormPage.ContentContainer), etc.).

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);
}
See Also