//--------------------------------------------------------------------- //THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY //KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE //IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A //PARTICULAR PURPOSE. //---------------------------------------------------------------------using System;using Microsoft.WindowsCE.Forms;class Program{ static void Main() { if(SystemSettings.ScreenOrientation == ScreenOrientation.Angle0) { // if portrait, change to landscape SystemSettings.ScreenOrientation = ScreenOrientation.Angle90; } else { // change to portrait SystemSettings.ScreenOrientation = ScreenOrientation.Angle0; } }}
'--------------------------------------------------------------------- 'THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY 'KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 'IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 'PARTICULAR PURPOSE. '---------------------------------------------------------------------Imports Microsoft.WindowsCE.FormsModule Module1 Sub Main() If (SystemSettings.ScreenOrientation = ScreenOrientation.Angle0) Then ' if portrait, change to landscape SystemSettings.ScreenOrientation = ScreenOrientation.Angle90 Else ' change to portrait SystemSettings.ScreenOrientation = ScreenOrientation.Angle0 End If End Sub End Module