XtraMdiTabPage Class
A tab page that represents an MDI child form.
Namespace: DevExpress.XtraTabbedMdi
Assembly: DevExpress.XtraBars.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
public class XtraMdiTabPage :
IXtraTabPage,
IXtraTabPageExt,
IDisposable,
IAnimatedItem,
ISupportXtraAnimation,
ISupportAdornerElementEx,
ISupportAdornerElement,
IUpdateAdornerUI
Related API Members
The following members return XtraMdiTabPage objects:
Remarks
An XtraMdiTabPage object represents an MDI child form when the main MDI form is managed by the XtraTabbedMdiManager component.
You can access all tab pages with the XtraTabbedMdiManager.Pages collection. Use the XtraMdiTabPage.MdiChild property to access the MDI child form to which the tab page corresponds.
Tab pages support animated images (animated GIF files). You can specify images for pages via the XtraMdiTabPage.Image or XtraMdiTabPage.ImageIndex property. Animation starts automatically at runtime. To stop and then restart animation, use the XtraMdiTabPage.StopAnimation and XtraMdiTabPage.StartAnimation methods, respectively.
Example
This example shows how to use an XtraTabbedMdiManager component to implement the tabbed interface in an MDI application.
The Load event handler of the main form (MDI Parent) binds an XtraTabbedMdiManager object to the form via the XtraTabbedMdiManager.MdiParent property.
The example creates a bar with the New
command. An MDI child form created by this command is automatically displayed as a tab by the XtraTabbedMdiManager.
The XtraTabbedMdiManager.PageAdded event handler customizes tooltips of created tab pages.
using DevExpress.XtraBars;
using DevExpress.XtraTabbedMdi;
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication4 {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
XtraTabbedMdiManager mdiManager;
private void Form1_Load(object sender, EventArgs e) {
// Create a Bar Manager that will display a bar of commands at the top of the main form.
BarManager barManager = new BarManager();
barManager.Form = this;
// Create a bar with a New button.
barManager.BeginUpdate();
Bar bar = new Bar(barManager, "My Bar");
bar.DockStyle = BarDockStyle.Top;
barManager.MainMenu = bar;
BarItem barItem = new BarButtonItem(barManager, "New");
barItem.ItemClick += new ItemClickEventHandler(barItem_ItemClick);
bar.ItemLinks.Add(barItem);
barManager.EndUpdate();
// Create an XtraTabbedMdiManager that will manage MDI child windows.
mdiManager = new XtraTabbedMdiManager(components);
mdiManager.MdiParent = this;
mdiManager.PageAdded += MdiManager_PageAdded;
}
private void MdiManager_PageAdded(object sender, MdiTabPageEventArgs e) {
XtraMdiTabPage page = e.Page;
page.Tooltip = "Tooltip for the page " + page.Text;
}
int ctr = 0;
void barItem_ItemClick(object sender, ItemClickEventArgs e) {
// Create an MDI child form.
Form2 f = new Form2();
f.Text = "Child Form " + (++ctr).ToString();
f.MdiParent = this;
f.Show();
}
}
}