public C1DockingTabPage AddNewTab(Form frm, String label) { //foreach (Control y in tC1.Controls) //{ // if (y is C1DockingTabPage) // { // if (y.Text.Equals("Import JOB")) // { // if (label.Equals("Import JOB")) // { // tC1.SelectedTab = (C1DockingTabPage)y; // return null; // } // } // } //} C1DockingTabPage tab = new C1DockingTabPage(); tab.SuspendLayout(); frm.TopLevel = false; tab.Width = tCC1.Width - 10; tab.Height = tCC1.Height - 35; frm.Parent = tab; frm.Dock = DockStyle.Fill; frm.Width = tab.Width; frm.Height = tab.Height; tab.Text = label; //foreach (Control x in frm.Controls) //{ // if (x is DataGridView) // { // //x.Dock = DockStyle.Fill; // } //} //tab.BackColor = System.Drawing.ColorTranslator.FromHtml("#1E1E1E"); frm.Visible = true; tC1.TabPages.Add(tab); //frm.Location = new Point((tab.Width - frm.Width) / 2, (tab.Height - frm.Height) / 2); frm.Location = new Point(0, 0); tab.ResumeLayout(); tab.Refresh(); tab.Text = label; if (bc.iniC.statusAppDonor.Equals("1")) { theme1.SetTheme(tC1, bc.iniC.themeDonor); } else { theme1.SetTheme(tC1, "Office2007Blue"); } tC1.SelectedTab = tab; //theme1.SetTheme(tC1, "Office2010Blue"); //theme1.SetTheme(tC1, "Office2010Green"); return(tab); }
public C1DockingTabPage AddNewTab(Form frm, String label) { frm.FormBorderStyle = FormBorderStyle.None; C1DockingTabPage tab = new C1DockingTabPage(); tab.SuspendLayout(); frm.TopLevel = false; tab.Width = tC1.Width - 10; tab.Height = tC1.Height - 35; tab.Name = frm.Name; frm.Parent = tab; frm.Dock = DockStyle.Fill; frm.Width = tab.Width; frm.Height = tab.Height; tab.Text = label; tab.TabIndex = tC1.TabCount + 1; //foreach (Control x in frm.Controls) //{ // if (x is DataGridView) // { // //x.Dock = DockStyle.Fill; // } //} //tab.BackColor = System.Drawing.ColorTranslator.FromHtml("#1E1E1E"); frm.Visible = true; //tC1.TabPages.Add(tab); tC1.TabPages.Insert(tC1.TabCount, tab); //frm.Location = new Point((tab.Width - frm.Width) / 2, (tab.Height - frm.Height) / 2); frm.Location = new Point(0, 0); tab.ResumeLayout(); tab.Refresh(); tab.Text = label; tab.Closing += Tab_Closing; theme1.SetTheme(tC1, bc.iniC.themeApplication); tC1.SelectedTab = tab; //theme1.SetTheme(tC1, "Office2010Blue"); //theme1.SetTheme(tC1, "Office2010Green"); return(tab); }