> >using System; >using System.Windows.Forms; > >namespace tabpagenotactivated >{ > public class Form1 : Form > { > public Form1() > { > this.tabControl1 = new System.Windows.Forms.TabControl(); > this.tabPage1 = new System.Windows.Forms.TabPage(); > this.tabPage2 = new System.Windows.Forms.TabPage(); > this.button1 = new System.Windows.Forms.Button(); > this.tabControl1.Controls.Add(this.tabPage1); > this.tabControl1.Controls.Add(this.tabPage2); > this.tabPage1.Controls.Add(this.button1); > this.button1.Location = new System.Drawing.Point(25, 39); > this.button1.Text = "activate second page"; > this.button1.Click += new System.EventHandler(this.button1_Click); > this.Controls.Add(this.tabControl1); > } > private System.Windows.Forms.TabControl tabControl1; > private System.Windows.Forms.TabPage tabPage1; > private System.Windows.Forms.TabPage tabPage2; > private System.Windows.Forms.Button button1; > private void button1_Click(object sender, EventArgs e) > { > tabPage2.Select(); > } > } > static class Program > { > static void Main() > { > Application.Run(new Form1()); > } > } > } >
// tabPage2.Select();
tabControl1.SelectedTab = tabPage2;
Cetin