First of all I want to thank "codeorder" for sharing me this code..

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        With Form2 
            .TabControl1.SelectedTab = .TabPage2 
            .ShowDialog() 
        End With
    End Sub

This code actually works in normal windows form but when I try to implement this code to mobile application form, it doesn't work and it has error 'SelectedTab' is not a member of 'System.Windows.Forms.TabControl'.. Please help me guys... Thanks

You can use "SelectedIndexChanged" from TabControl on Mobile Device:

Private Sub MainTabControl_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MainTabControl.SelectedIndexChanged

' 1. Tab
If MainTabControl.SelectedIndex = 0 Then
MsgBox ("Hello From Tab 1")
End If

' 2. Tab
If MainTabControl.SelectedIndex = 1 Then
MsgBox ("Hello From Tab 2")
End If

' 3. Tab
If MainTabControl.SelectedIndex = 2 Then
MsgBox ("Hello From Tab 3")
End If

.................
.................
.................
End Sub

You can use "SelectedIndexChanged" from TabControl on Mobile Device:

Private Sub MainTabControl_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MainTabControl.SelectedIndexChanged

' 1. Tab
If MainTabControl.SelectedIndex = 0 Then
MsgBox ("Hello From Tab 1")
End If

' 2. Tab
If MainTabControl.SelectedIndex = 1 Then
MsgBox ("Hello From Tab 2")
End If

' 3. Tab
If MainTabControl.SelectedIndex = 2 Then
MsgBox ("Hello From Tab 3")
End If

.................
.................
.................
End Sub

It doesn't work dude...huhu.. :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.