So I have these two forms. On the 1st form, I have a button and on the 2nd form, I put a tabindex and created a two tab pages. If I click the the button, I want to go to the 2nd tabpage. here's my code..

TabPages2.show()

It doesn't work guys.. please help me guys. I'm still a noob... Thank you

you need to show the 2nd form first before calling tabpage2.show.

dim objfrm as new form2
         objfrm.show()
         TabPages2.show()

im not sure abt TabPages2.show()
u may need to do activate or someother things.. try out

See if this helps. Place on Form1.

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        With Form2 '// shorten code.
            .TabControl1.SelectedTab = .TabPage2 '// select Tab.
            .ShowDialog() '// display as MsgBox, not giving access to previous Form until closed.
        End With
    End Sub

See if this helps. Place on Form1.

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        With Form2 '// shorten code.
            .TabControl1.SelectedTab = .TabPage2 '// select Tab.
            .ShowDialog() '// display as MsgBox, not giving access to previous Form until closed.
        End With
    End Sub

Hey men.. Thanks a lot.. It really works, I try it on a normal windows form but It doesn't work on mobile application... Maybe you can help me men... Thanks a lot...

Edited 5 Years Ago by jefroxnergal: n/a

This article has been dead for over six months. Start a new discussion instead.