views:

260

answers:

2

I'm making a winform in C# using Visual Studio 2008.

Currently, I have a tabcontrol, containing 2 tabs. In the first the, there is a button. When I click it, I must be taken to the second tab.

Problem is, I don't know how. I've tried debugging, looking into al kinds of Properties and messing around with them, but I found nothing that helps.

Does anybody here know how to pull this off?

Extra info: my variables are named tabControl1, textTab and logTab.

I'm in textTab, click on a button there and I want to be taken to logTab. That's it basically.

+3  A: 

Did you try this?

tabControl1.SelectedTab = logTab;
Matt Brunell
Goddamit... yeah that solved it... so damn simple...thanks for the help
Vordreller
+1  A: 

You can set either the SelectedIndex property or the SelectedTab property of the tab control to switch tabs.

rdeetz