Selecting Page in TabControl [solved]

Posts 1–4 of 4 · Page 1 of 1
Selecting Page in TabControl [solved]
Hey this time I'm having a problem with tab controls. I have a tab control with 3 tabs and I one of then I have a link label. The link label is in tab 3 and the code on it should do this:
Code:
TabPage1.Show()
and It does show the the tab page but the selected tab at the top does not change
Does anyone know what it is that I'm doing wrong?
Thank you.
Various way of doing it. As always, you should be thinking about the parent container rather than the TabPage, each TabPage is independent of the other tabpages and as such, you need to refer back to their parent container to determine which page is showing etc.

[highlight=vb.net]
TabControl1.SelectTab(zero based tab index here) 'ie 0, 1, 2, 3...etc
'or
TabControl1.SelectTab(TabPageObjectHere) 'ie TabPage1
'or
TabControl1.SelectTab("TabPageNameHere") 'ie "TabPage1"
[/highlight]
Thanks took me a while as I was doing this
Code:
TabControl1.SelectTab(TabPage1)
instead of this
Code:
TabControl1.SelectTab = (TabPage1)
Marked solved.
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us