BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
this.tabbedMDIManager1.TabControlAdded += TabbedMDIManager1_TabControlAdded;
Form2 form = new Form2 { Text = "Titulos" };
form.BackColor = Color.Red;
form.MdiParent = this;
form.Show();
this.mainFrameBarManager1.Style = VisualStyle.Office2016Colorful;
this.barItem1.Click += ParentBarItem1_Click;
}
private void TabbedMDIManager1_TabControlAdded(object sender, TabbedMDITabControlEventArgs args)
{
tabcontrol = args.TabControl;
}
private void ParentBarItem1_Click(object sender, System.EventArgs e)
{
MetroForm form = new MetroForm { Text = "Empresas" };
var childrenFind = this.tabbedMDIManager1.MdiChildren.Where(f => f.Text == form.Text).Any();
if (!childrenFind)
{
form.MdiParent = this;
form.Show();
}
else
{
if(tabcontrol != null)
{
foreach(TabPageAdv page in tabcontrol.TabPages)
{
if(page.Text== form.Text)
{
// focus on the flap that is already open
tabcontrol.SelectedTab = page;
break;
}
}
}
}
}
}
} |