Sub Globals
Dim Phone1 As Phone
Dim cmdPortrait As Button
Dim cmdLandscape As Button
Dim cmdBothOrientations As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
cmdPortrait.Initialize("cmdPortrait")
cmdPortrait.Text = "Only portrait"
cmdLandscape.Initialize("cmdLandscape")
cmdLandscape.Text = "Only landscape"
cmdBothOrientations.Initialize("cmdBothOrientations")
cmdBothOrientations.Text = "Both orientations"
Activity.AddView(cmdPortrait, 40dip, 50dip, 100%X - 80dip, 60dip)
Activity.AddView(cmdLandscape, 40dip, 110dip, 100%X - 80dip, 60dip)
Activity.AddView(cmdBothOrientations, 40dip, 170dip, 100%X - 80dip, 60dip)
End Sub
Sub cmdPortrait_Click
Phone1.SetScreenOrientation(1)
End Sub
Sub cmdLandscape_Click
Phone1.SetScreenOrientation(0)
End Sub
Sub cmdBothOrientations_Click
Phone1.SetScreenOrientation(-1)
End Sub