//全局变量
int count;
int index = 0;
public Form2()//窗体构造器
{
InitializeComponent();
count = tabControl1.TabPages.Count;//记录tabpage的总量
}
private void button1_Click(object sender, EventArgs e)//鼠标点击事件
{
index++;
index = index % count;//索引对总量取余数,防止索引超出
tabControl1.SelectedIndex = index;
}