Share via


SystemSettings.ScreenOrientation Property

Gets or sets the current screen orientation of a device.

Namespace: Microsoft.WindowsCE.Forms
Assembly: Microsoft.WindowsCE.Forms (in microsoft.windowsce.forms.dll)

Syntax

'Declaration
Public Shared Property ScreenOrientation As ScreenOrientation
'Usage
Dim value As ScreenOrientation

value = SystemSettings.ScreenOrientation

SystemSettings.ScreenOrientation = value
public static ScreenOrientation ScreenOrientation { get; set; }
public:
static property ScreenOrientation ScreenOrientation {
    ScreenOrientation get ();
    void set (ScreenOrientation value);
}
/** @property */
public static ScreenOrientation get_ScreenOrientation ()

/** @property */
public static void set_ScreenOrientation (ScreenOrientation value)
public static function get ScreenOrientation () : ScreenOrientation

public static function set ScreenOrientation (value : ScreenOrientation)
Not applicable.

Property Value

One of the ScreenOrientation values, which are 0, 90, 180, and 270. The default is 0.

Remarks

You can change the portrait orientation value to 90, 180, or 270 without resetting the device.

Example

The following code example sets the value of this property to 0 and displays the value in a status bar. This code example is part of a larger example provided for the SystemSettings class.

' Set the screen orientation to normal
' and display the value on the status bar.
SystemSettings.ScreenOrientation = ScreenOrientation.Angle0
Me.StatusBar1.Text = SystemSettings.ScreenOrientation.ToString()
// Set the screen orientation to normal
// and display the value on the status bar.
SystemSettings.ScreenOrientation = ScreenOrientation.Angle0;
this.statusBar1.Text = SystemSettings.ScreenOrientation.ToString();

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

SystemSettings Class
SystemSettings Members
Microsoft.WindowsCE.Forms Namespace