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

Edited 5 Years Ago by kaplanerkan: n/a

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.. :(

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