Sub VP_PageSelected (Position As Int)
Try
If bar.SelectedIndex <> Position Then bar.SelectedIndex = Position
Catch
Msgbox(LastException,"Error VP_PageSelected")
End Try
If Position = 0 Then
Dim jo As JavaObject = smWrapper1
jo.RunMethod("setSlidingEnabled", Array(True)) 'or false
Dim jo As JavaObject = smWrapper2
jo.RunMethod("setSlidingEnabled", Array(False)) 'or false
Else 'smWrapper2 for the rest of the tabs, except tab 0
Dim jo As JavaObject = smWrapper1
jo.RunMethod("setSlidingEnabled", Array(False)) 'or false
Dim jo As JavaObject = smWrapper2
jo.RunMethod("setSlidingEnabled", Array(True)) 'or false
End If
End Sub