Olá pessoal eu preciso criuar quantas TabPage for necessários, dependendo do calculo, essas tabPage irão aparecer no form para usuário. Eu usei um for para criar mas não da certo, não da erro não acontece nada! Alguém pode me ajudar por favor? int j = 1;
for (int i = ano1; i >= ano2;i++ ) {
this.tabControl2.Controls.Add(this.tabela+j = new TabPage ());
this.tabControl2.Location = new System.Drawing.Point(12, 12);
this.tabControl2.Name = "tab";
this.tabControl2.SelectedIndex = 0;
this.tabControl2.Size = new System.Drawing.Size(268, 100);
this.tabControl2.TabIndex = 0;
this.tabela.Location = new System.Drawing.Point(4, 22);
this.tabela.Name = "tabPage" + j;
this.tabela.Padding = new System.Windows.Forms.Padding(3);
this.tabela.Size = new System.Drawing.Size(260, 74);
this.tabela.TabIndex = 0;
this.tabela.Text = i.ToString ();
this.tabela.UseVisualStyleBackColor = true;
j = j + 1;
}
this.Controls.Add(tabControl2);