public void NewTab (string TabName) { TabItem newtab1; usercontrol_1 a1 = new usercontrol_1(); a1.Dock = DockStyle.Fill; newtab1 = this.tabControl1.CreateTab(TabName); newtab1.AttachedControl.Controls.Add(a1); this.tabControl1.SelectedTab = newtab1; }
Form1 f1 = new Form1(); f1.NewTab("new tab"); f1.show();
foreach (Form form in Application.OpenForms) { if (form is Form1) { Form1 f = (Form1)form; f.NewTab("new tab"); break; } }
Form1 f1 = (this.Parent as Form1); f1.NewTab("new tab");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)