日期:2014-05-17 浏览次数:20904 次
TabPage tp = new TabPage();
tp.Text = "商品详细";
tabControl1.TabPages.Add(tp);
/// <summary>
/// 为私有的tabControl1封装一个共有的属性,便于直接在Form3中访问
/// </summary>
public TabControl TabControlNew
{
get { return this.tabControl1; }
set { this.tabControl1 = value; }
}
private void button1_Click(object sender, EventArgs e)
{
Form3 frm = new Form3();
frm.Tag = this.TabControlNew;
frm.Show();
}
private void button1_Click(object sender, EventArgs e)
{
((TabControl)this.Tag).TabPages.Add(new TabPage("NewPage"));
}