Tab Control Question..........
I need to code a command button to switch to a different tab on my tab control. A user is filling out something ont he first tab and then needs to be able to just hit the command button to go to the next tab without having to manually click on the tabs a at the top to switch between then. How do I activate a differnent tab?
Re: Tab Control Question..........
Your button code will look like this
VB Code:
TabControl1.SelectedTab = TabControl1.TabPages(1)
This will take you from what ever your current tab is to the second tab page. But thats the general code. You can play around with it and tweak it how ever you need.
Re: Tab Control Question..........
I'm not sure why clicking a button is easier than clicking a tab, but you can set either the SelectedIndex or SelectedTab property of the TabControl. To go to the next tab try:
VB Code:
myTabControl.SelectedIndex += 1
Make sure you don't call this without checking that you aren't on the last tab already or you'll get an exception.