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.
To create a TabControl control at design-time, you simply drag and drop a TabControl control from Toolbox onto a Form in Visual Studio. After you drag and drop a TabControl on a Form, the TabControl1 is added to the Form and looks like Figure 1. A TabControl is just a container and has no value without tab pages.
We can switch one tab to another tab with Selenium webdriver in C#. Sometimes on clicking a link or a button, we can have multiple tabs opened in the same browser. By default, the webdriver can access only the parent tab. To access the second tab, we have to switch the driver focus with the help of the SwitchTo().
Win Form has been used to develop many applications. Because of its high age (born in 2003), WinForm was officially declared dead by Microsoft in 2014. However, Win Form is still alive and well.
Did you try this?
tabControl1.SelectedTab = logTab;
You can set either the SelectedIndex property or the SelectedTab property of the tab control to switch tabs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With