Alot
Alot

Reputation: 1

CSharp: How to goto next tab by pressing a button

What would be the algorithm to make it so upon pressing a button inside the first tab of a tab control so that you get switched to second tab.

Upvotes: 0

Views: 4047

Answers (2)

Hans Passant
Hans Passant

Reputation: 942307

    private void button1_Click(object sender, EventArgs e) {
        tabControl1.SelectedIndex = 1;
    }

Upvotes: 4

Sasha Reminnyi
Sasha Reminnyi

Reputation: 3532

this.tabControl1.SelectedTab = tabPage2/*needed tab*/;

Upvotes: 1

Related Questions