using System.Windows.Forms; class ex : Form { TabControl tc = new TabControl(); TabPage tp1 = new TabPage(); TabPage tp2 = new TabPage(); TextBox tb1 = new TextBox(); Button b1 = new Button(); ex() { Text = "hello"; Controls.Add(tc); tp1.Text = "Tab1"; tp2.Text = "Tab2"; tc.TabPages.Add(tp1); tc.TabPages.Add(tp2); tp1.Controls.Add(tb1); b1.Text = "Example"; tp2.Controls.Add(b1); } static public void Main() { Application.Run(new ex()); } }