שתף באמצעות


Visual Basic changing tabs by clicking a button

Question

Friday, September 13, 2013 8:00 AM

Hello, i have a little problem with tabs in my program.I created 5 tabs, in each tab some stuff, buttons and so on, what the program needs. And in one tab there is a button which should open another tab. And thats my code, which is working:

    Private Sub button35_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button35.Click
        TabPage2.Show()
    End Sub

Program is switching tabs but not switching the name of a tab. I mean for example: we are on TabPage5, we have a button with reference to TabPage2, we are clicking it, tab is changing but we still see on the top of our program title TabPage5. Is there any possibility that it would change to title TabPage2 after clicking button?

All replies (2)

Friday, September 13, 2013 8:25 AM ✅Answered | 1 vote

Try instead:

     TabControl1.SelectedTab = TabPage2

Armin


Friday, September 13, 2013 8:29 AM

It is working now, thank you!