Form2 form2 = new Form2();
form2 .Dock = DockStyle.Fill;
this.documentManager1.View.BeginUpdate();
this.documentManager1.View.AddDocument(form2 ).Caption = "测试";
this.documentManager1.View.ActivateDocument(form2 );
this.documentManager1.View.EndUpdate();
int index = 0;
foreach (var document in tabbedView1.Documents)
{
if (document.Caption == "测试")
{
tabbedView1.ActivateDocument(document.Control);//激活测试界面
}
index++;
}
tabbedView1.DocumentClosing += TabClose;
private void TabClose(object sender, DocumentCancelEventArgs e)
{
if (e.Document.Caption == "测试")
{
e.Cancel = true; //取消关闭事件
}
}
tabbedView1.DocumentGroupProperties.HeaderLocation = DevExpress.XtraTab.TabHeaderLocation.Bottom;