I'm trying to make a tab page change on SelectedIndexChanged event of a combo box.
I have used select case statements to try and do it, but can't get the tab to change.
I have tried tabpage.select , tabpage.focus , and few others, but none of them seem to work.
I don't get why not, though the select one would work, so what am I doing wrong?
You change it through the tabcontrol itself, not the tabpage.
So it would be something like
tabcontrol1.SelectedIndex = combobox1.selectedindex
(if the combobox and tabpages indexes match)
otherwise I am sure from this you can get it working how you need.
The tab control also has a .SelectedTab property you can set, but you would need to set it to a TabPage object, and its probably going to be easier to use indexes here.
This code was working fine, but then the tabs rearranged themselves and so the wrong page opens with the combobox. Is there anyway to lock the tabs so that they don't move? I have tried the lock property but that doesn't work.
That code does exactly the same. The only difference from your code and my code, is the fact that I have named the tabs differently, which I wouldn't think makes any difference.
well what im saying is, when you select the first item in the combobox, the first tab is selected. You select the second item in the combobox, the second tab becomes selected, etc...