日期:2014-05-20 浏览次数:20912 次
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
tp = tabControl1.SelectedTab;
}
private TabPage tp;
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
foreach (Control c in tp.Controls.Cast<Control>().ToList())
{
tp.Controls.Remove(c);
tabControl1.SelectedTab.Controls.Add(c);
}
tp = tabControl1.SelectedTab;
}
}
}