C#从入门到精通(第5版)C#\C#从入门到精通(第5版)\2. TM(实例源程序)\sl\11\31\Test31 这个案例
namespace Test31
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
tabControl1.ImageList = imageList1;
tabPage1.ImageIndex = 0;
tabPage2.ImageIndex = 0;
tabControl1.Appearance = TabAppearance.Normal;
//tabControl1.Controls.AddRange(new TabPage MyTabPage);
//Controls.Add(tabControl1);
Controls.Add(tabControl1);
string Title = "新增选项卡EWEW " + (tabControl1.TabCount + 1).ToString();
TabPage MyTabPage = new TabPage(Title);
tabControl1.TabPages.Add(MyTabPage);
}
private void tabPage1_Click(object sender, EventArgs e)
{
}
}
}